Swapping a neural network model at runtime.
-
@sinewavekid
The snip found in this thread will get you goinghttps://forum.hise.audio/topic/10756/hardcoded-neural-network-does-not-work-as-expected/10
-
awesome thank you! ill try to get one network working smoothly today, then test out some methods to make a combobox to select between networks and also somehow reload/clear/initialize them. my first guess would be to make some function which clears out/resets the old network somehow, a quick chatgpt gave me something like this, but im sure itll need tweaking
// Define the model(s) const var MLmodel_1 = {MODEL1 JSON HERE}; const var MLmodel_2 = {MODEL2 JSON HERE}; const var tf = Engine.createNeuralNetwork("TensorFlowNetwork"); //function to clear/initialize the models (can be linked to a combobox in the future) function loadModel() { tf.clearModel(); tf.reset(); //no idea if this is needed lol tf.loadTensorFlowModel(MLmodel_1); } loadModel();hopefully it's a start to keep experimenting !
-
@sinewavekid you need to create multiple networks for each model and then select them from the node via the drop down.
-
@Christoph-Hart said in Swapping a neural network model at runtime.:
@sinewavekid you need to create multiple networks for each model and then select them from the node via the drop down.
But, beyond multiple neural models, the CPU usage is not working efficiently even in a single model right now.
Did you fix the high cpu usage problem?
-
@Christoph-Hart
I had assumed that "NeuralNetwork.clearModel()" would allow me to reset the NN, then I could follow with a new "NeuralNetwork.loadTensorFlowModel( var modelJSON)" function call. It obviously doesn't work this way.....but it would be amazing if it could....just sayin...lol. -
@Christoph-Hart awesome thank you for the info that is super helpful! is it possible to then select between them via scripting or by linking to a combobox or slider?
-
@scottmire The photo from HISE Developer for Tinder.
-
@JulesV no.
-
@clevername27 LOL....I feel a bit bad about that. I didn't know it would do that.
-
@Christoph-Hart said in Swapping a neural network model at runtime.:
@JulesV no.
A friendly bump. Please don't be angry with me. Still no? :)