Public

API

# Latte.NetType.

Fields

• ensembles – a vector containing each Ensemble in the network.
• ensembles_map – a mapping between ensemble names in the network to the instance stored in ensembles
• buffers – the internal buffers used by the network
• curr_buffer_set – the current buffer set (used for double buffering)
• forward_tasks – a set of tasks for performing forward propogation of the network
• backward_tasks – a set of tasks for performing back propogation of the network
• update_tasks – a set of tasks for performing parameter updates
• params – a vector of Param instances corresponding to network parameters
• run_where – DEPRECATED
• signal – DEPRECATED
• batch_size – the batch size of the network TODO: support different batch sizes for train/test
• train_epoch – number of epochs completed for training
• test_epoch – number of epochs completed for testing
• curr_time_step – the current time step (for RNNs)
• time_steps – total number of time steps to unroll (for RNNs)
• num_subgroups – number of partitions in network (for model parallelism)
• ensemble_send_list – a mapping between ensembles and a list of subgroups to send values to, used internally when synthesizing code for model parallelism

# Latte.NetMethod.

Main Net constructor that should be used. Params - batch_size – batch size of the network - time_steps – number of time steps to unroll the network (for RNNs) - num_subgroups – number of subgroups in the network (for model parallelism)

# Latte.EnsembleType.

An ensemble

Fields

• name – name of the ensemble
• neurons – an array of neurons of type T
• connections – a list of Ensembles connected to this ensemble
• batch_fields – a vector of Batch fields for T (used internally)
• arg_dim_info –
• params – a vector of Params associated with the ensemble
• phase – phase(s) in which this ensemble is active
• net_subgroup – the net subgroup the ensemble is a member of (use for model parallelism)

# Latte.ConnectionType.

A connection between two ensembles.

Fields

• source – the source Ensemble
• mapping – a mapping function to a range of neurons in source
• shape – shape of the connected neurons returned by mapping
• size – length of the connected neurons returned by mapping
• copy – whether the connection requires input values to be copied
• is_dim_fixed – vector of booleans that are true if the connection is fixed along a dimension
• is_one_to_one – whether the connection is one to one
• padding – amount of padding used for the connection
• recurrent – whether the connection is recurrent

# Latte.ParamType.

A parameter in a Net (learned during training)

Fields

• name – the name of the parameter
• gradient_name – the name of the gradient (should be ∇name)
• hist_name – the name of the history buffer (should be namehist)
• learning_rate – local learning rate for the parameter
• regu_coef – local regularization coefficient
• clip_gradients – NOT IMPLEMENTED, gradient clipping parameter
• value – buffer containing the value of the parameter
• gradient – buffer containing the gradient of the parameter
• hist – buffer containing the history of the parameter
• request – request id, used for MPI data parallelism

# Latte.get_bufferMethod.

Get a buffer at the time_step t

Params

• net – network to get buffer
• name – name of the buffer
• t – time step

# Latte.add_connectionsMethod.

Connect neurons in source to neurons in sink using the function mapping. mapping should be a function with a parameter for the index in each dimension of sink. For example, if sink is a 3-d ensemble, mapping = f(i, j, k) -> ...

mapping should return a tuple of continuous ranges corresponding to the indices of neurons in source that should be connected to the neuron at the current index

# Latte.add_ensembleMethod.

Add an ensemble to the network net

# Latte.initMethod.

Initialize the network net.

This function begins by initializing each Ensemble in the Network. This is done by calling init(ens) which will be dispatched to the appropriate initialization routine. These initialization routines are responsible for adding buffers to the network to contain neuron fields and output values. See the specific initialization functions for different Ensemble types for more information (TODO: Reference these).

After initializaing the local fields and output values for each ensemble, we then initialize the input buffers for each ensemble. This is done after all output values have been initialized so that we can analyze recurrent connections. This is done by calling the init_inputs(ens) routine.

# Latte.load_snapshotMethod.

Load a network snapshot from file.

TODO: Can we save the structure of net in the snapshot?

# Latte.save_snapshotMethod.

Save a snapshot of net to file

# Latte.testMethod.

Test net for one epoch