Welcome to our Support Center

Set store gradient by name

Description

Sets the boolean “store_gradient ? ” of the layer selected by the name given as input. If the boolean is “True”, then the gradient of the previous iteration of the layer is stored in memory.

Input parameters

 

Model in : model architecture.
 name : stringlayer name.
store_gradient? : boolean, stores in memory the gradiant if true.

Output parameters

 

Model out : model architecture.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install HAIBAL library to run it).

Using the “Set Store Grad by name” function

1 – Define Graph

We define the graph with one input and two Dense layers named Dense1 and Dense2 parameterized in different ways.

2 – Set Function

We use the “Set Store Grad by name” function to store gradients of layer named Dense2 in memory.

3 – Get Function

We use the “Get All Store Grad” function to get the value of the “store_gradient?” parameter for all layers of the model.

Table of Contents