NeuralNetwork
You can create a NeuralNetwork
object with Engine.createNeuralNetwork("String id")
. Please take a look at the NeuralNetwork Sine Generator Snippet
to take a look at a working example.
const var nn = Engine.createNeuralNetwork("NeuralNetwork");
Class methods
build
Create a network using the given JSON for the layer setup. Edit on GitHub
NeuralNetwork.build( var modelJSON)
clearModel
Destroys the model and allows rebuilding using a different layout JSON. Edit on GitHub
NeuralNetwork.clearModel()
connectToGlobalCables
Connects the network to a input and output global cable. Edit on GitHub
NeuralNetwork.connectToGlobalCables(String inputId, String outputId)
createModelJSONFromTextFile
Helper function to create a JSON model definition from the Pytorch print(model) output. Edit on GitHub
NeuralNetwork.createModelJSONFromTextFile(var fileObject)
getModelJSON
Returns the model JSON. Edit on GitHub
NeuralNetwork.getModelJSON()
loadOnnxModel
Loads the ONNX runtime model for spectral analysis. Edit on GitHub
NeuralNetwork.loadOnnxModel( var base64Data, int numOutputValues)
loadPytorchModel
Loads the model layout and weights from a Pytorch model JSON. Edit on GitHub
NeuralNetwork.loadPytorchModel( var modelJSON)
loadTensorFlowModel
Loads the model layout and weights from a tensorflow model JSON. Edit on GitHub
NeuralNetwork.loadTensorFlowModel( var modelJSON)
loadWeights
Loads the weights from the JSON object. Edit on GitHub
NeuralNetwork.loadWeights( var weightData)
process
Runs inference on the given input and returns either a single float or a reference to the output buffer. Edit on GitHub
NeuralNetwork.process(var input)
processFFTSpectrum
Processes the FFT spectrum and returns the output tensor as array of float numbers. Edit on GitHub
NeuralNetwork.processFFTSpectrum(var fftObject, int numFreqPixels, int numTimePixels)
reset
Resets the network pipeline. Edit on GitHub
NeuralNetwork.reset()