Keras metrics export

Hi,

I want to export the Keras metrics(accuracy and loss) as flow variables in order to be seen by other nodes.
I tried different approaches such as add them in the FlowObjectStack class and to update them with the final values or to add them in the m_stack with the final values after the Keras Network Learner has finished its execution. Also, I tried to add them in the DLKerasDefaultTrainingConfig class and to update them from here but didn’t worked to actualize these metrics with the final values.
I tried even to create workflow variables and update them with the final results from the Keras Network Learner node and didn’t worked. Can you give me a recommendation please?

Thank you,
Mihai

Hi @mihais1

Please find a possible solution to your question in the workflow below. The solution is implemented using the “DL Python Network Executor”:

20200616r Pikairos Keras metrics export.knwf (32.0 KB)

(This workflow is reset but data self-contained)

You will need to adapt it to the metrics you have used in the definition of your network. The important code to get the metrics from the network evaluation is highlighted in yellow:

I implemented this a bit too fast so, although it works, it may not be the optimal solution. At least, it should provide you with hints to improve it further and adapt it to your needs.

Hope this is of help :smile:

Best regards,

Ael

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.