Apache SINGA
A distributed deep learning platform .
|
The neural network is constructed from user configurations in NetProto. More...
#include <neuralnet.h>
Public Member Functions | |
NeuralNet (NetProto netproto, int npartitions=1) | |
construct the net structure from protocol buffer. More... | |
std::string | ToAdjacency () |
To display the adjacency layers. | |
void | ShareParamsFrom (shared_ptr< NeuralNet > other) |
Share memory of parameter values from other neuralnet. | |
const std::vector< Layer * > & | layers () |
const std::vector< ParserLayer * > & | parserlayers () const |
const std::vector< LossLayer * > & | losslayers () const |
const std::vector< DataLayer * > & | datalayers () const |
const std::vector< Param * > & | params () const |
Layer * | name2layer (string name) const |
Param * | paramid2param (int id) const |
Static Public Member Functions | |
static shared_ptr< NeuralNet > | Create (const NetProto &np, Phase phase, int num) |
Create the neural network for training, test or validation. More... | |
Protected Member Functions | |
Graph * | CreateGraph (const NetProto &netproto, int npartitions) |
Create a neural net graph, one node for each layer. More... | |
void | CreateNetFromGraph (Graph *graph, int npartitions) |
Create neural net from graph, one layer per node. | |
void | PrepareDataStructures () |
prepare data structures, e.g., params_, layers_, etc. | |
Protected Attributes | |
vector< Layer * > | layers_ |
vector< ParserLayer * > | parserlayers_ |
vector< LossLayer * > | losslayers_ |
vector< DataLayer * > | datalayers_ |
vector< Param * > | params_ |
map< string, Layer * > | name2layer_ |
map< int, Param * > | paramid2param_ |
The neural network is constructed from user configurations in NetProto.
Some layers, e.g., SplitLayer and BridgeSrcLayer/BridgeDstLayer will be added implicitly to partition the neural network. TODO create wrappers for popular models, e.g., MLP, CNN.
|
explicit |
construct the net structure from protocol buffer.
netproto | neural net config |
npartitions | num of partitions. 1 for no partitioning. |
|
static |
Create the neural network for training, test or validation.
Parameters for test/validation net can share those from training after setup (done outside of this funcion).
np | proto for the neural network |
phase | test/training/validation |
num | num of partitions, do partitioning if num > 1 |
|
protected |
Create a neural net graph, one node for each layer.
Partition the graph if npartitions > 1, each layer is sliced according to its own partition setting.
netproto |