Coder Social home page Coder Social logo

Comments (2)

Vika-F avatar Vika-F commented on July 16, 2024

Intel(R) DAAL provides the ability to get the value of the loss function for every batch.
And based on this value you can define any stopping criteria you like.
Please make the following modifications to the sample to access the value of the loss function.

First, save the identifier of the loss layer when initializing the topology of a network.
Please add following global variable into the sample:

LayerIds layerIds;

This variable will hold the identifiers of all layers in the topology.

Second, change the line that creates the topology by providing the storage for layers' identifiers:

/* Configure the neural network topology */
topology = configureNet(&layerIds);

And third, here is the code that prints the value of the loss function after compute() step on the local nodes.

/* Perform forward and backward pass through the neural network to compute weights and biases derivatives on worker node */
netLocal->compute();

/* Get the model of the neural network on local node */
training::ModelPtr trainingModel = netLocal->input.get(training::inputModel);
/* Get the result of the loss layer */
services::SharedPtr<layers::forward::Result> lossLayerResult = trainingModel->getForwardLayer(layerIds.sm)->getLayerResult();
/* Print the value computed by the loss layer */
printTensor(lossLayerResult->get(layers::forward::value), "loss value: ");

Regarding the "accuracyThreshold" parameter of the optimization solver.
The present version of the library does not use this parameter for the neural network training.
We investigate the options for adding support of accuracy threshold to the neural network training algorithm to have its behavior more configurable in the future releases of the library.

Best regards,
Victoriya

from onedal.

fleapapa avatar fleapapa commented on July 16, 2024

Thanks a lot for the tip!

Will an option for calculating one single loss on master node (ie., netMaster) be also investigated? The option can be a big convenience, especially for topologies with many worker nodes.

from onedal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.