Commit da776b0c authored by André Anjos's avatar André Anjos 💬

Merge branch 'fix_loop_parameters_handling' into 'master'

Fix loop parameters handling

See merge request !93
parents 3da9a398 aae9920b
Pipeline #33443 passed with stages
in 21 minutes and 14 seconds
......@@ -1257,6 +1257,8 @@ class Experiment(object):
else:
parameters = dict(parameters) # copy
parameters.update(config_data.get(algorithm_prefix + "parameters", {}))
environment = config_data.get(
algorithm_prefix + "environment",
self.data["globals"]["environment"],
......
......@@ -25,5 +25,12 @@
}
}
}
]
],
"parameters": {
"step": {
"default": 1,
"type": "int8",
"description": "Counter step size"
}
}
}
......@@ -38,11 +38,18 @@ import numpy as np
class Algorithm:
def __init__(self):
self.step = 1
def setup(self, parameters):
self.step = parameters["step"]
return True
def process(self, data_loaders, outputs, loop_channel):
cnt = 1
is_valid, delta = loop_channel.validate({"value": np.full(10, cnt)})
while not is_valid:
cnt = cnt + 1
cnt = cnt + self.step
is_valid, delta = loop_channel.validate({"value": np.full(10, cnt)})
delta = delta.value
......
......@@ -6,6 +6,7 @@
"loop_super_block": {
"processor_algorithm": "user/db_input_loop_processor/1",
"processor_parameters": {
"step": 1
},
"processor_inputs": {
"in": "in"
......@@ -62,8 +63,11 @@
"version": "1.3.0"
},
"queue": "queue",
"user/db_input_loop_processor/1": {
"step": 2
},
"user/db_input_loop_evaluator/1" : {
"threshold": 1
"threshold": 8
}
}
}
......@@ -97,8 +97,11 @@
"version": "1.3.0"
},
"queue": "queue",
"user/db_input_loop_processor/1" : {
"step": 1
},
"user/db_input_loop_evaluator/1" : {
"threshold": 1
"threshold": 2
},
"user/block_input_loop_evaluator/1" : {
"threshold": 9
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment