diff options
author | Determinant <[email protected]> | 2015-06-16 12:46:41 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2015-06-16 12:46:41 +0800 |
commit | 2ab9610a4fff798c1668cdc041515256fa813865 (patch) | |
tree | 3450e26ef7ea5eaeec870bbddb3c33c512320a6e /doc/nerv_nn.md | |
parent | 341b8b8c57cc4ee6f3fb940f00d9c8265e0b42a5 (diff) | |
parent | c3db7ffba45b7e4d0a1d76281e187b3f88129db9 (diff) |
Merge branch 'master' of https://github.com/Determinant/nerv
Diffstat (limited to 'doc/nerv_nn.md')
-rw-r--r-- | doc/nerv_nn.md | 32 |
1 files changed, 32 insertions, 0 deletions
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 |