Welcome to our Support Center

Set all store gradient

Description

Sets the boolean “store_gradient ? ” of all layers contained in the model. If the boolean is “True”, then the gradient from the previous iteration of the layer is stored in memory.

Input parameters

 

Model in : model architecture.
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 All Store Grad” 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 All Store Grad” function to store gradients 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