Welcome to our Support Center

Read and Soft Update Weights

Description

Read the asked weights present in the CheckpointState stored in local then update the inference weights. A TrainingSession with this CheckpointState must be in memory for this function to work.

Input parameters

 

 Academic Training in object, academic training session.
coefficient : float, soft update factor; target weights are updated as :
UpdatedTargetWeight = BaseModelWeight * coefficient + (1 – coefficient) * TargetWeight

 

Output parameters

 

 Academic Training out object, academic training session.

 Weights Info cluster

weight_names : array, list of names identifying each weight tensor used for training or marked as frozen. These correspond to a subset of the model’s initializers, specifically those involved in learning or fixed parameters, not all initializers present in the ONNX graph.
raw_data_out : array, raw byte representation of each weight tensor, flattened into 1D. This field stores the actual binary content of the tensor.
data_shapes : array, shape of each tensor, provided as an array of dimensions. This allows reconstructing the original structure of the tensor from the flattened raw_data_out.
data_types : array, ONNX data type (enum) of each tensor, such as FLOAT, INT32, FLOAT16, etc. Defines how to interpret the raw bytes.
data_ranks : array, rank of each tensor (number of dimensions), for example :

        • Scalar → 0
        • Vector → 1
        • Matrix → 2
        • Higher-order tensors → 3+

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 Deep Learning library to run it).
Table of Contents