Welcome to our Support Center

Get Weights Shape by name

Description

Gets the shape of the weights of the layer selected by the name given as input.

Input parameters

 

Model in : model architecture.
Β name :Β string,Β layer name.

Output parameters

 

Model out : model architecture.

weight_shape : cluster

index : integer, index of layer.
name : string, name of layer.
weights : array

name : string, name of weight.
shape : array, shape of weight.

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 β€œGet Weights Shape by name” function

1 – Define Graph

We define the graph with one input and two Dense layers named Dense1 and Dense2.

2 – Set Function

We use the “Set All Random Weights” function to create random weights for all layers which have weights in the model.

3 – Get Function

We use the “Get Weights Shape by name” function to get the shape of the layer weights named Dense2.

Table of Contents