Added edge_intelligence examples and edge_component packages along with tests.#2
Added edge_intelligence examples and edge_component packages along with tests.#2lucifercr07 wants to merge 44 commits into
Conversation
|
|
||
| #### [EDGE_INTELLIGENCE_MODEL_PATH] #### | ||
|
|
||
| ModelPath = "Model-Path" No newline at end of file |
There was a problem hiding this comment.
I have done the change.
| # 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. |
There was a problem hiding this comment.
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" | |||
| @@ -0,0 +1,59 @@ | |||
| from __future__ import absolute_import | |||
There was a problem hiding this comment.
Remove python3 support, add the license.
Move this to example/edge_intelligence/trained_models
| @@ -1,90 +0,0 @@ | |||
| import tensorflow as tf | |||
There was a problem hiding this comment.
All files which are being shown outdated moved to examples/edge_intelligence/trained_models
| @@ -0,0 +1,31 @@ | |||
| 30,1 | |||
| import numpy as np | ||
| import tensorflow as tf | ||
|
|
||
| # Data sets |
| @@ -0,0 +1,20 @@ | |||
| This folder contains example files for different models: pfa, sklearn, tensorflow, rule. | |||
|
|
||
| # 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. |
There was a problem hiding this comment.
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.
| ``` | ||
| 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. |
There was a problem hiding this comment.
Create the ruleEdge and pass it onto RuleEdgeComponent.
Action_actuator_parameter explain
exceed_limit explin
actuator_udm explain with full form
| ``` | ||
| edge_component = RuleEdgeComponent(ModelRule,exceed_limit,actuator_udm=action_actuator) | ||
| ``` | ||
| After this just register the edge_component and start_collecting the values from sensor. |
There was a problem hiding this comment.
the values which will get published to RuleEdge component. Please refer the example.
| #### [DEFAULT] #### | ||
|
|
||
| EdgeSystemName = "EdgeSystem-Name" | ||
| EdgeSystemName = "EdgeSystem-prasha" |
| name="windmill.AmbientTemperature", | ||
| unit=ureg.degC, | ||
| interval=0, | ||
| interval=10, |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
actuator_udm and mention the comment before function.
| import random | ||
|
|
||
| config = {} | ||
| execfile('../sampleProp.conf', config) |
There was a problem hiding this comment.
It's correct checked.
| return round(random.uniform(2.0,7.0),2) | ||
|
|
||
| def collect_rpm_vib(): | ||
| l = [get_rpm(), get_vibration()] |
There was a problem hiding this comment.
rename it two parameters mention in READMe currently tested for single metric.
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| graphite = Graphite(SocketDccComms(ip=config['GraphiteIP'],port=8080)) |
|
|
||
| #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) |
There was a problem hiding this comment.
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) |
| sampling_function=get_rpm_for_model | ||
| ) | ||
|
|
||
| #Model-Path can be edited in the sampleProp.conf file |
There was a problem hiding this comment.
Add comment and show one metric, correct the comment formatting.
| GraphiteIP = "92.246.246.188" | ||
| GraphitePort = 2003 | ||
|
|
||
| #### [EDGE_INTELLIGENCE_MODEL_PATH] #### |
| ['BSD_LICENSE.txt', 'BSD_NOTICE.txt']), | ||
| (os.path.abspath(os.sep) + '/../var/log/liota', [])] | ||
| ) | ||
| ) No newline at end of file |
…em_stats_with_filter.py failing to load
tensorflow_edge_component, rule_edge_component.py).
graphite_rule_thermistor_simulated.py, graphite_rule_windmill_simulated.py,
graphite_sklearn_windmill_simulated.py, graphite_tensorflow_windmill_simulated.py).