From 71f639f82fd7f238568ae86e54afaed17951b290 Mon Sep 17 00:00:00 2001 From: cloudygoose Date: Wed, 10 Jun 2015 22:12:25 +0800 Subject: doc change(nn) --- README.md | 3 ++- doc/nerv_nn.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 doc/nerv_nn.md diff --git a/README.md b/README.md index f825e57..6a0f1e4 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ The IO package is used to read and write parameters to file. The parameter package is used to store, read model parameters from file. * __[The Nerv Layer Package](doc/nerv_layer.md)__ The layer package is used to define propagation and backpropagation of different type of layers. - +* __[The Nerv NN Package](doc/nerv_nn.md)__ +The nn package is for organizing a neural network, it contains __nerv.LayerRepo__, __nerv.ParamRepo__, and __nerv.DAGLayer__. [luaT]:https://github.com/torch/torch7/tree/master/lib/luaT [Torch]:https://github.com/torch [sync-help]:https://help.github.com/articles/syncing-a-fork/ diff --git a/doc/nerv_nn.md b/doc/nerv_nn.md new file mode 100644 index 0000000..54c7165 --- /dev/null +++ b/doc/nerv_nn.md @@ -0,0 +1,32 @@ +#The Nerv NN Package# +Part of the [Nerv](../README.md) toolkit. + +##Description## +###Class hierarchy### +it contains __nerv.LayerRepo__, __nerv.ParamRepo__, and __nerv.DAGLayer__(inherits __nerv.Layer__). + +###Class hierarchy and their members### +* __nerv.ParamRepo__ Get parameter object by ID. + * `table param_table` Contains the mapping of parameter ID to parameter file(__nerv.ChunkFile__) +* __nerv.LayerRepo__ Get layer object by ID. + * `table layers` Contains the mapping of layer ID to layer object. +objects. +* __nerv.DAGLayer__ inherits __nerv.Layer__. + +##Methods## +###__nerv.ParamRepo__### +* __void ParamRepo:\_\_init(table param_files)__ +`param_files` is a list of file names that stores parameters, the newed __ParamRepo__ will read them from file and store the mapping for future fetching. +* __nerv.Param ParamRepo.get_param(ParamRepo self, string pid, table global_conf)__ +__ParamRepo__ will find the __nerv.ChunkFile__ `pf` that contains parameter of ID `pid` and return `pf:read_chunk(pid, global_conf)`. + +###__nerv.LayerRepo__### +* __void LayerRepo:\_\_init(table layer_spec, ParamRepo param_repo, table global_conf)__ +__LayerRepo__ will construct the layers specified in `layer_spec`. Every entry in the `layer_spec` table should follow the format below: +``` +layer_spec : {[layer_type1] = llist1, [layer_type2] = llist2, ...} +llist : {layer1, layer2, ...} +layer : layerid = {param_config, layer_config} +param_config : {param1 = paramID1, param2 = paramID2} +``` +__LayerRepo__ will merge `param_config` into `layer_config` and construct a layer by calling `layer_type(layerid, global_conf, layer_config)`. \ No newline at end of file -- cgit v1.2.3-70-g09d2