Methods
mask.visualize( )
Description
Print out the generated masks.
Usage
The example below will create a MultiArea
object with 3 areas. mask.visualize()
is called to print out the generated masks.
Output:
mask.get_masks( )
Description
Return layer masks in a list.
Returns
masks
: (list) A list of masks. Each mask is a 2D numpy array.
Usage
Output The first np.ndarray is the input mask, the second is the hidden mask, and the third is the readout mask.
mask.get_readout_indices( )
Description
Get the indices of the neurons that are being read out from.
Returns
readout_idx
: (np.ndarray) The indices of the neurons that are being read out from.
Usage
Output
mask.get_input_indices( )
Description
Get the indices of the neurons that receive inputs.
Returns
input_idx
: (np.ndarray) The indices of the input neurons. Will be a 1D array of shape(input_dim,)
.
Usage
Output
mask.get_non_input_indices( )
Description
Get the indices of the neurons that receive inputs.
Returns
non_input_idx
: (np.ndarray) The indices of neurons that don’t receive inputs.
Usage
The example below will create a MultiArea
object with 3 areas, where the first area is the input area. The get_non_input_indices()
method will return indices of neurons in area 2 and 3, as they don’t receive inputs.
Output
mask.get_areas( )
Description
Retrieve the area names
Returns
area_names
: (list) A list of area names.
Usage
Output
mask.get_area_indices( )
Description
Get the node indices of a specific area.
Parameters
area
: (str) or (int), required. The name of the area or the index of the area.
Returns
indices
: (np.ndarray) The indices of the nodes in the specified area.
Usage
Output