Skip to content

Added edge_intelligence examples and edge_component packages along with tests.#2

Closed
lucifercr07 wants to merge 44 commits into
KohliDev:edge_intelligencefrom
lucifercr07:edge_intelligence
Closed

Added edge_intelligence examples and edge_component packages along with tests.#2
lucifercr07 wants to merge 44 commits into
KohliDev:edge_intelligencefrom
lucifercr07:edge_intelligence

Conversation

@lucifercr07

@lucifercr07 lucifercr07 commented Jul 2, 2017

Copy link
Copy Markdown
Collaborator
  1. Added ModelPath to conf file for the edge_intelligence_models e.g windmill_iotcc_pfa.py etc.
  2. Removed the training files from edge_intelligence_models i.e eval-build.py and build-model.py
  3. Added readme information to the edge_intelligence_models.
  4. Removed file_reader_package.py from edge_component
  5. Added comments for actuator in edge_intelligence_models e.g windmill_iotcc_pfa.py etc.
  6. Added loadModel for the tensor_flow_edge_component.py
  7. Added files windmill_graphite_tf.py and windmill_iotcc_tf.py to the edge_intelligence_models.
  8. Added rule_edge_component
  9. Added windmill_graphite_rule.py
  10. Added packages for edge_components (sklearn_edge_component, pfa_component,
    tensorflow_edge_component, rule_edge_component.py).
  11. Example packages for each edge_component (graphite_pfa_windmill_simulated.py,
    graphite_rule_thermistor_simulated.py, graphite_rule_windmill_simulated.py,
    graphite_sklearn_windmill_simulated.py, graphite_tensorflow_windmill_simulated.py).
  12. Tests for edge_components under tests folder.

Comment thread examples/sampleProp.conf Outdated

#### [EDGE_INTELLIGENCE_MODEL_PATH] ####

ModelPath = "Model-Path" No newline at end of file

@KohliDev KohliDev Jul 3, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done the change.

@lucifercr07 lucifercr07 changed the title Changes made to the branch edge intelligence model Added rule_edge_component and modifications to tensor flow model Jul 16, 2017
@lucifercr07 lucifercr07 changed the title Added rule_edge_component and modifications to tensor flow model Added edge_intelligence examples and edge_component packages along with tests. Aug 10, 2017
Comment thread edge_intelligence_models/README.md Outdated
# Edge Intelligence Models

Place holder for Edge intelligence models No newline at end of file
Saved pfa, sklearn and tensorflow models are present under the windmill-models directory.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trained pfa ...

<PFA, SKlearn , Tensorflow link>
The generated data is using the TI sensor tag which has been used for training the windmill model.
It provides a basic example which uses TI sensor tag data to simulate a sample windmill model. The basic metrics we collect from Windmill model are:

@@ -0,0 +1,3 @@
model_checkpoint_path: "model.ckpt-2000"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trained_tf_model

@@ -0,0 +1,59 @@
from __future__ import absolute_import

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove python3 support, add the license.
Move this to example/edge_intelligence/trained_models

@@ -1,90 +0,0 @@
import tensorflow as tf

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change file permission to 644

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All files which are being shown outdated moved to examples/edge_intelligence/trained_models

@@ -0,0 +1,31 @@
30,1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain the usage of all files

import numpy as np
import tensorflow as tf

# Data sets

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments.

Comment thread examples/edge_intelligence/Readme.md Outdated
@@ -0,0 +1,20 @@
This folder contains example files for different models: pfa, sklearn, tensorflow, rule.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PFA, RuleEdge

Comment thread examples/edge_intelligence/Readme.md Outdated

# RuleEdgeComponent

Rule edge component is like different edge components provided by Liota, you can define a simple rule depending on your requirement as a lambda function and the rule edge component will process the incoming metrics and give output to the actuator on the basis of the rule you have defined as lambda function.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of the edge intelligences components.

Lambda

The result can be passed onto actuator on basis of the rule you have defined as lambda function.

Comment thread examples/edge_intelligence/Readme.md Outdated
```
Rule = lambda x : 0 if (rpm>=rpm_limit) else 0
```
Now just pass the rule to RuleEdgeComponent along with the action_actuator and exceed_limit.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create the ruleEdge and pass it onto RuleEdgeComponent.

Action_actuator_parameter explain
exceed_limit explin
actuator_udm explain with full form

Comment thread examples/edge_intelligence/Readme.md Outdated
```
edge_component = RuleEdgeComponent(ModelRule,exceed_limit,actuator_udm=action_actuator)
```
After this just register the edge_component and start_collecting the values from sensor.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the values which will get published to RuleEdge component. Please refer the example.

Comment thread examples/sampleProp.conf Outdated
#### [DEFAULT] ####

EdgeSystemName = "EdgeSystem-Name"
EdgeSystemName = "EdgeSystem-prasha"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all the parameters value

name="windmill.AmbientTemperature",
unit=ureg.degC,
interval=0,
interval=10,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check in SensorTag before committing this code.

actuator_udm=action_actuator)
#Model-Path can be edited in the sampleProp.conf file
#pass value to actuator as of now the action_actuator prints the value on the console
edge_component = PFAComponent(config['ModelPath'], actuator_udm=action_actuator)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actuator_udm and mention the comment before function.

import random

config = {}
execfile('../sampleProp.conf', config)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path correct

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's correct checked.

return round(random.uniform(2.0,7.0),2)

def collect_rpm_vib():
l = [get_rpm(), get_vibration()]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename it two parameters mention in READMe currently tested for single metric.


if __name__ == '__main__':

graphite = Graphite(SocketDccComms(ip=config['GraphiteIP'],port=8080))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8080 read from sampleProp.conf


#Model-Path can be edited in the sampleProp.conf file
#pass value to actuator as of now the action_actuator prints the value on the console
edge_component = PFAComponent(config['ModelPath'],actuator_udm=action_actuator)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment about PFA component.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show one metric publishing to DCC same metric to Edge_Component

)
#Model-Path can be edited in the sampleProp.conf file
#pass value to actuator as of now the action_actuator prints the value on the console
edge_component = SKLearnEdgeComponent(config['ModelPath'],actuator_udm=action_actuator)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention comment about Sklearn

sampling_function=get_rpm_for_model
)

#Model-Path can be edited in the sampleProp.conf file

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment and show one metric, correct the comment formatting.

Comment thread examples/sampleProp.conf Outdated
GraphiteIP = "92.246.246.188"
GraphitePort = 2003

#### [EDGE_INTELLIGENCE_MODEL_PATH] ####

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edge_Intelligence

Comment thread setup.py Outdated
['BSD_LICENSE.txt', 'BSD_NOTICE.txt']),
(os.path.abspath(os.sep) + '/../var/log/liota', [])]
)
) No newline at end of file

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add extra line

@lucifercr07 lucifercr07 closed this Nov 3, 2017
@lucifercr07 lucifercr07 deleted the edge_intelligence branch November 3, 2017 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants