Welcome to our Support Center

Set store gradient by index

Description

Sets the boolean “store_gradient ? ” of the layer selected by the index 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.
 index : integerlayer index.
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 index” 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 index” function to store gradients of layer at index 2 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