Welcome to our Support Center

Set all loss type by index

Description

Sets the loss of each layer contained in the model selected by the index.

Input parameters

 

Model in : model architecture.

loss_type_array : array

output_order : integer, output number.
 loss_type : enum, name of the losse used by the layer.
loss_axis : integer, the axis on which the losse performs its calculation.

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 Loss Type” function

1 – Define Graph

We define two graphs with one input and two dense layers. In the first graph the dense layers are named Dense1 and Dense2. In the second one we named the layers Dense3 and Dense4.

2 – Merge Function

We use the “Merge” function to merge the two graphs.

3 – Set Function

The “Set All Loss Type” function is used to define the loss to be applied to each graph. For the first graph we will apply the “MeanSquare” loss on axis 1 and for the second we will apply the “BinaryCrossentropy” loss on axis 0.

2 – Get Function

We use the function “Get All Loss Type” to get all the loss applied to the model.

Tags:
Table of Contents