Public
Contents
Index
Latte.Connection
Latte.Ensemble
Latte.Net
Latte.Net
Latte.Param
Latte.add_connections
Latte.add_ensemble
Latte.get_buffer
Latte.init
Latte.load_snapshot
Latte.save_snapshot
Latte.test
API
#
Latte.Net
— Type.
Fields
ensembles
– a vector containing eachEnsemble
in the network.ensembles_map
– a mapping between ensemble names in the network to the instance stored inensembles
buffers
– the internal buffers used by the networkcurr_buffer_set
– the current buffer set (used for double buffering)forward_tasks
– a set of tasks for performing forward propogation of the networkbackward_tasks
– a set of tasks for performing back propogation of the networkupdate_tasks
– a set of tasks for performing parameter updatesparams
– a vector ofParam
instances corresponding to network parametersrun_where
– DEPRECATEDsignal
– DEPRECATEDbatch_size
– the batch size of the network TODO: support different batch sizes for train/testtrain_epoch
– number of epochs completed for trainingtest_epoch
– number of epochs completed for testingcurr_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.Net
— Method.
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.Ensemble
— Type.
An ensemble
Fields
- name – name of the ensemble
- neurons – an array of neurons of type
T
- connections – a list of
Ensemble
s connected to this ensemble - batch_fields – a vector of
Batch
fields forT
(used internally) - arg_dim_info –
- params – a vector of
Param
s 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.Connection
— Type.
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.Param
— Type.
A parameter in a Net
(learned during training)
Fields
name
– the name of the parametergradient_name
– the name of the gradient (should be ∇name
)hist_name
– the name of the history buffer (should bename
hist)- 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_buffer
— Method.
Get a buffer at the time_step t
Params
net
– network to get buffername
– name of the buffert
– time step
#
Latte.add_connections
— Method.
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_ensemble
— Method.
Add an ensemble to the network net
#
Latte.init
— Method.
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_snapshot
— Method.
Load a network snapshot from file
.
TODO: Can we save the structure of net
in the snapshot?
#
Latte.save_snapshot
— Method.
Save a snapshot of net
to file
#
Latte.test
— Method.
Test net
for one epoch