previous_workspace = workspace.CurrentWorkspace()
workspace.SwitchWorkspace(self._workspace_id)
for name, value in states.items():
workspace.FeedBlob(name, np.atleast_1d(value).astype(np.float32))
for name, value in actions.items():
workspace.FeedBlob(name, np.atleast_1d(value).astype(np.float32))
workspace.RunNet(self._net)
After Change
examples = []
for i in range(len(states)):
examples.append({**states[i], **actions[i]})
return RLPredictor.predict(self, examples)
def get_predictor_export_meta(self):
return PredictorExportMeta(
self._net, self._parameters, self._input_blobs, self._output_blobs