aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2016-02-15 15:04:13 +0800
committerDeterminant <ted.sybil@gmail.com>2016-02-15 15:04:13 +0800
commit3362020a6bc43766a92882abe6d127c8bb98a628 (patch)
treecad93eb88c2813694c0ae4ca4ecb9873a719ad85
parentdcad8a3f80fc55ca93984d981f9b829d2e4ea728 (diff)
try a basic merge
-rw-r--r--Makefile4
-rw-r--r--nerv/Makefile13
-rw-r--r--nerv/config.ld8
-rw-r--r--nerv/doc/lua/index.html71
-rw-r--r--nerv/doc/lua/ldoc_pale.css304
-rw-r--r--nerv/doc/lua/modules/layer.affine.html145
-rw-r--r--nerv/doc/lua/modules/matrix.html409
-rw-r--r--nerv/doc/lua/modules/nerv.html428
-rw-r--r--nerv/examples/asr_trainer.lua18
-rw-r--r--nerv/init.lua64
-rw-r--r--nerv/io/sgd_buffer.lua31
-rw-r--r--nerv/layer/affine.lua56
-rw-r--r--nerv/layer/bias.lua2
-rw-r--r--nerv/layer/combiner.lua13
-rw-r--r--nerv/layer/mse.lua17
-rw-r--r--nerv/layer/softmax_ce.lua11
-rw-r--r--nerv/layer/window.lua2
-rw-r--r--nerv/lib/common.c1
-rw-r--r--nerv/lib/io/chunk_file.c3
-rw-r--r--nerv/lib/matrix/cukernel.h2
-rw-r--r--nerv/lib/matrix/generic/cukernel.cu6
-rw-r--r--nerv/lib/matrix/generic/cumatrix.c2
-rw-r--r--nerv/lib/matrix/generic/mmatrix.c505
-rw-r--r--nerv/lib/matrix/generic/mmatrix.h45
-rw-r--r--nerv/lib/matrix/matrix.h2
-rw-r--r--nerv/lib/matrix/mmatrix.c5
-rw-r--r--nerv/matrix/generic/cumatrix.c294
-rw-r--r--nerv/matrix/generic/matrix.c213
-rw-r--r--nerv/matrix/generic/mmatrix.c60
-rw-r--r--nerv/matrix/init.lua57
-rw-r--r--nerv/matrix/mmatrix.c3
-rw-r--r--nerv/nerv-scm-1.rockspec2
-rw-r--r--nerv/nn/layer_dag.lua9
-rw-r--r--nerv/nn/param_repo.lua6
-rw-r--r--nerv/test/cumatrix_func.lua2
-rw-r--r--nerv/test/cumatrix_func.out1952
-rw-r--r--nerv/test/matrix_func.lua168
-rw-r--r--nerv/test/mmatrix_func.lua2
-rw-r--r--nerv/test/mmatrix_func.out1952
39 files changed, 6540 insertions, 347 deletions
diff --git a/Makefile b/Makefile
index 72a5915..0982295 100644
--- a/Makefile
+++ b/Makefile
@@ -11,5 +11,9 @@ install:
speech:
cd speech/speech_utils; $(PREFIX)/bin/luarocks make
cd speech/htk_io; $(PREFIX)/bin/luarocks make
+ cd speech/kaldi_io; $(PREFIX)/bin/luarocks make
clean:
cd nerv && make clean
+ cd speech/speech_utils && make clean
+ cd speech/htk_io && make clean
+ cd speech/kaldi_io && make clean
diff --git a/nerv/Makefile b/nerv/Makefile
index 5c329f9..0c6b380 100644
--- a/nerv/Makefile
+++ b/nerv/Makefile
@@ -32,11 +32,11 @@ LIBS := $(INST_LIBDIR)/libnerv.so $(LIB_PATH)/libnervcore.so $(LIB_PATH)/libluaT
LUA_LIBS := matrix/init.lua io/init.lua init.lua \
layer/init.lua layer/affine.lua layer/sigmoid.lua layer/tanh.lua layer/softmax_ce.lua layer/softmax.lua \
layer/window.lua layer/bias.lua layer/combiner.lua layer/mse.lua layer/affine_recurrent.lua \
- layer/elem_mul.lua layer/gate_fff.lua \
+ layer/elem_mul.lua layer/gate_fff.lua \
nn/init.lua nn/layer_repo.lua nn/param_repo.lua nn/layer_dag.lua \
io/sgd_buffer.lua \
- tnn/init.lua tnn/layer_dag_t.lua tnn/sutil.lua tnn/tnn.lua \
- tnn/layersT/dropout_t.lua tnn/layersT/lstm_t.lua tnn/layersT/softmax_ce_t.lua
+ tnn/init.lua tnn/layer_dag_t.lua tnn/sutil.lua tnn/tnn.lua \
+ tnn/layersT/dropout_t.lua tnn/layersT/lstm_t.lua tnn/layersT/softmax_ce_t.lua
INCLUDE := -I $(LUA_INCDIR) -DLUA_USE_APICHECK
#CUDA_BASE := /usr/local/cuda-7.0
@@ -45,9 +45,8 @@ CUDA_INCLUDE := -I $(CUDA_BASE)/include/
INCLUDE += $(CUDA_INCLUDE)
LDFLAGS := -L$(CUDA_BASE)/lib64/ -Wl,-rpath=$(CUDA_BASE)/lib64/ -lcudart -lcublas -lcurand
-CFLAGS := -Wall -Wextra -O2
NVCC := $(CUDA_BASE)/bin/nvcc
-NVCC_FLAGS := -Xcompiler -fPIC,-Wall,-Wextra
+NVCC_FLAGS := -Xcompiler -fPIC,-Wextra
LUA_LIBS := $(addprefix $(LUA_DIR)/,$(LUA_LIBS))
@@ -58,12 +57,12 @@ $(OBJ_DIR) $(LUA_DIR) $(OBJ_SUBDIR) $(LUA_SUBDIR) $(INC_SUBDIR):
$(OBJ_DIR)/%.o: %.c $(patsubst /%.o,/%.c,$@)
gcc -c -o $@ $< $(INCLUDE) -fPIC $(CFLAGS)
$(OBJ_DIR)/lib/matrix/cukernel.o: lib/matrix/cukernel.cu
- $(NVCC) -c -o $@ $< $(INCLUDE) $(NVCC_FLAGS) $(CFLAGS)
+ $(NVCC) -c -o $@ $< $(INCLUDE) $(NVCC_FLAGS)
$(LUA_DIR)/%.lua: %.lua
cp $< $@
$(LIB_PATH)/libnervcore.so: $(CORE_OBJS)
- gcc -shared -o $@ $^ $(LDFLAGS)
+ gcc -shared -o $@ $^ $(LDFLAGS) -lcblas
$(LIB_PATH)/libluaT.so: $(LUAT_OBJS)
gcc -shared -o $@ $^ $(LDFLAGS)
$(INST_LIBDIR)/libnerv.so: $(NERV_OBJS) $(LIB_PATH)/libnervcore.so $(LIB_PATH)/libluaT.so
diff --git a/nerv/config.ld b/nerv/config.ld
new file mode 100644
index 0000000..f60b53f
--- /dev/null
+++ b/nerv/config.ld
@@ -0,0 +1,8 @@
+project = 'NERV'
+title = 'NERV documentation'
+description = 'A Lua-based toolkit for high-performance deep learning'
+backtick_references = true
+file = {'./', exclude = {'./lib/luaT'}}
+dir = 'doc/lua'
+style = '!pale'
+kind_names = {topic = 'Manual',script = 'Programs'}
diff --git a/nerv/doc/lua/index.html b/nerv/doc/lua/index.html
new file mode 100644
index 0000000..56212cc
--- /dev/null
+++ b/nerv/doc/lua/index.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<head>
+ <title>NERV documentation</title>
+ <link rel="stylesheet" href="ldoc_pale.css" type="text/css" />
+</head>
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo"></div>
+ <div id="product_name"><big><b></b></big></div>
+ <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+
+<div id="main">
+
+
+<!-- Menu -->
+
+<div id="navigation">
+<br/>
+<h1>NERV</h1>
+
+
+
+
+<h2>Modules</h2>
+<ul class="$(kind=='Topics' and '' or 'nowrap'">
+ <li><a href="modules/nerv.html">nerv</a></li>
+ <li><a href="modules/layer.affine.html">layer.affine</a></li>
+ <li><a href="modules/matrix.html">matrix</a></li>
+</ul>
+
+</div>
+
+<div id="content">
+
+
+ <h2>A Lua-based toolkit for high-performance deep learning</h2>
+
+<h2>Modules</h2>
+<table class="module_list">
+ <tr>
+ <td class="name" nowrap><a href="modules/nerv.html">nerv</a></td>
+ <td class="summary">NERV: a Lua-based toolkit for high-performance deep learning.</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="modules/layer.affine.html">layer.affine</a></td>
+ <td class="summary">Parameter and layer classes related to linear transform.</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="modules/matrix.html">matrix</a></td>
+ <td class="summary">Implements a fraction of matrix operations (methods) in Lua, while
+ others are implemented in C extension.</td>
+ </tr>
+</table>
+
+</div> <!-- id="content" -->
+</div> <!-- id="main" -->
+<div id="about">
+<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
+<i style="float:right;">Last updated 2016-01-15 14:56:30 </i>
+</div> <!-- id="about" -->
+</div> <!-- id="container" -->
+</body>
+</html>
diff --git a/nerv/doc/lua/ldoc_pale.css b/nerv/doc/lua/ldoc_pale.css
new file mode 100644
index 0000000..b071110
--- /dev/null
+++ b/nerv/doc/lua/ldoc_pale.css
@@ -0,0 +1,304 @@
+/* BEGIN RESET
+
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.html
+version: 2.8.2r1
+*/
+html {
+ color: #000;
+ background: #FFF;
+}
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
+ margin: 0;
+ padding: 0;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+fieldset,img {
+ border: 0;
+}
+address,caption,cite,code,dfn,em,strong,th,var,optgroup {
+ font-style: inherit;
+ font-weight: inherit;
+}
+del,ins {
+ text-decoration: none;
+}
+li {
+ list-style: disc;
+ margin-left: 20px;
+}
+caption,th {
+ text-align: left;
+}
+h1,h2,h3,h4,h5,h6 {
+ font-size: 100%;
+ font-weight: bold;
+}
+q:before,q:after {
+ content: '';
+}
+abbr,acronym {
+ border: 0;
+ font-variant: normal;
+}
+sup {
+ vertical-align: baseline;
+}
+sub {
+ vertical-align: baseline;
+}
+legend {
+ color: #000;
+}
+input,button,textarea,select,optgroup,option {
+ font-family: inherit;
+ font-size: inherit;
+ font-style: inherit;
+ font-weight: inherit;
+}
+input,button,textarea,select {*font-size:100%;
+}
+/* END RESET */
+
+body {
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: arial, helvetica, geneva, sans-serif;
+ background-color: #ffffff; margin: 0px;
+}
+
+code, tt { font-family: monospace; font-size: 1.1em; }
+span.parameter { font-family:monospace; }
+span.parameter:after { content:":"; }
+span.types:before { content:"("; }
+span.types:after { content:")"; }
+.type { font-weight: bold; font-style:italic }
+
+body, p, td, th { font-size: .95em; line-height: 1.2em;}
+
+p, ul { margin: 10px 0 0 0px;}
+
+strong { font-weight: bold;}
+
+em { font-style: italic;}
+
+h1 {
+ font-size: 1.5em;
+ margin: 0 0 20px 0;
+}
+h2, h3, h4 { margin: 15px 0 10px 0; }
+h2 { font-size: 1.25em; }
+h3 { font-size: 1.15em; }
+h4 { font-size: 1.06em; }
+
+a:link { font-weight: bold; color: #004080; text-decoration: none; }
+a:visited { font-weight: bold; color: #006699; text-decoration: none; }
+a:link:hover { text-decoration: underline; }
+
+hr {
+ color:#cccccc;
+ background: #00007f;
+ height: 1px;
+}
+
+blockquote { margin-left: 3em; }
+
+ul { list-style-type: disc; }
+
+p.name {
+ font-family: "Andale Mono", monospace;
+ padding-top: 1em;
+}
+
+pre {
+ background-color: rgb(245, 245, 245);
+ border: 1px solid #C0C0C0; /* silver */
+ padding: 10px;
+ margin: 10px 0 10px 0;
+ overflow: auto;
+ font-family: "Andale Mono", monospace;
+}
+
+pre.example {
+ font-size: .85em;
+}
+
+table.index { border: 1px #00007f; }
+table.index td { text-align: left; vertical-align: top; }
+
+#container {
+ margin-left: 1em;
+ margin-right: 1em;
+ background-color: #ffffff;
+}
+
+#product {
+ text-align: center;
+ border-bottom: 1px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#product big {
+ font-size: 2em;
+}
+
+#main {
+ background-color:#FFFFFF; // #f0f0f0;
+ //border-left: 2px solid #cccccc;
+}
+
+#navigation {
+ float: left;
+ width: 14em;
+ vertical-align: top;
+ background-color:#FFFFFF; // #f0f0f0;
+ border-right: 2px solid #cccccc;
+ overflow: visible;
+}
+
+#navigation h2 {
+ background-color:#FFFFFF;//:#e7e7e7;
+ font-size:1.1em;
+ color:#000000;
+ text-align: left;
+ padding:0.2em;
+ //border-top:1px solid #dddddd;
+ border-bottom:1px solid #dddddd;
+}
+
+#navigation ul
+{
+ font-size:1em;
+ list-style-type: none;
+ margin: 1px 1px 10px 1px;
+}
+
+#navigation li {
+ text-indent: -1em;
+ display: block;
+ margin: 3px 0px 0px 22px;
+}
+
+#navigation li li a {
+ margin: 0px 3px 0px -1em;
+}
+
+#content {
+ margin-left: 14em;
+ padding: 1em;
+ width: 700px;
+ border-left: 2px solid #cccccc;
+ // border-right: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#about {
+ clear: both;
+ padding: 5px;
+ border-top: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+@media print {
+ body {
+ font: 12pt "Times New Roman", "TimeNR", Times, serif;
+ }
+ a { font-weight: bold; color: #004080; text-decoration: underline; }
+
+ #main {
+ background-color: #ffffff;
+ border-left: 0px;
+ }
+
+ #container {
+ margin-left: 2%;
+ margin-right: 2%;
+ background-color: #ffffff;
+ }
+
+ #content {
+ padding: 1em;
+ background-color: #ffffff;
+ }
+
+ #navigation {
+ display: none;
+ }
+ pre.example {
+ font-family: "Andale Mono", monospace;
+ font-size: 10pt;
+ page-break-inside: avoid;
+ }
+}
+
+table.module_list {
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.module_list td {
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.module_list td.name { background-color: #f0f0f0; ; min-width: 200px; }
+table.module_list td.summary { width: 100%; }
+
+table.function_list {
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.function_list td {
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.function_list td.name { background-color: #f6f6ff; ; min-width: 200px; }
+table.function_list td.summary { width: 100%; }
+
+dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
+dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
+dl.table h3, dl.function h3 {font-size: .95em;}
+
+ul.nowrap {
+ overflow:auto;
+ whitespace:nowrap;
+}
+
+/* stop sublists from having initial vertical space */
+ul ul { margin-top: 0px; }
+ol ul { margin-top: 0px; }
+ol ol { margin-top: 0px; }
+ul ol { margin-top: 0px; }
+
+/* make the target distinct; helps when we're navigating to a function */
+a:target + * {
+ background-color: #FF9;
+}
+
+
+/* styles for prettification of source */
+pre .comment { color: #558817; }
+pre .constant { color: #a8660d; }
+pre .escape { color: #844631; }
+pre .keyword { color: #aa5050; font-weight: bold; }
+pre .library { color: #0e7c6b; }
+pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
+pre .string { color: #8080ff; }
+pre .number { color: #f8660d; }
+pre .operator { color: #2239a8; font-weight: bold; }
+pre .preprocessor, pre .prepro { color: #a33243; }
+pre .global { color: #800080; }
+pre .user-keyword { color: #800080; }
+pre .prompt { color: #558817; }
+pre .url { color: #272fc2; text-decoration: underline; }
+
diff --git a/nerv/doc/lua/modules/layer.affine.html b/nerv/doc/lua/modules/layer.affine.html
new file mode 100644
index 0000000..817fc37
--- /dev/null
+++ b/nerv/doc/lua/modules/layer.affine.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<head>
+ <title>NERV documentation</title>
+ <link rel="stylesheet" href="../ldoc_pale.css" type="text/css" />
+</head>
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo"></div>
+ <div id="product_name"><big><b></b></big></div>
+ <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+
+<div id="main">
+
+
+<!-- Menu -->
+
+<div id="navigation">
+<br/>
+<h1>NERV</h1>
+
+<ul>
+ <li><a href="../index.html">Index</a></li>
+</ul>
+
+<h2>Contents</h2>
+<ul>
+<li><a href="#Class_nerv_MatrixParam">Class nerv.MatrixParam </a></li>
+<li><a href="#Class_nerv_AffineLayer">Class nerv.AffineLayer </a></li>
+</ul>
+
+
+<h2>Modules</h2>
+<ul class="$(kind=='Topics' and '' or 'nowrap'">
+ <li><a href="../modules/nerv.html">nerv</a></li>
+ <li><strong>layer.affine</strong></li>
+ <li><a href="../modules/matrix.html">matrix</a></li>
+</ul>
+
+</div>
+
+<div id="content">
+
+<h1>Module <code>layer.affine</code></h1>
+<p>Parameter and layer classes related to linear transform.</p>
+<p></p>
+
+
+<h2><a href="#Class_nerv_MatrixParam">Class nerv.MatrixParam </a></h2>
+<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#MatrixParam:read">MatrixParam:read (handle)</a></td>
+ <td class="summary">Read from a file handle.</td>
+ </tr>
+</table>
+<h2><a href="#Class_nerv_AffineLayer">Class nerv.AffineLayer </a></h2>
+<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#AffineLayer:__init">AffineLayer:__init (id, global_conf, layer_conf)</a></td>
+ <td class="summary">The constructor.</td>
+ </tr>
+</table>
+
+<br/>
+<br/>
+
+
+ <h2 class="section-header has-description"><a name="Class_nerv_MatrixParam"></a>Class nerv.MatrixParam </h2>
+
+ <div class="section-description">
+ A parameter that consists of a single matrix
+ </div>
+ <dl class="function">
+ <dt>
+ <a name = "MatrixParam:read"></a>
+ <strong>MatrixParam:read (handle)</strong>
+ </dt>
+ <dd>
+ Read from a file handle.
+
+
+ <h3>Parameters:</h3>
+ <ul>
+ <li><span class="parameter">handle</span>
+ the file handle
+ </li>
+ </ul>
+
+
+
+
+
+</dd>
+</dl>
+ <h2 class="section-header has-description"><a name="Class_nerv_AffineLayer"></a>Class nerv.AffineLayer </h2>
+
+ <div class="section-description">
+ A fully-connected linear transform layer.
+ </div>
+ <dl class="function">
+ <dt>
+ <a name = "AffineLayer:__init"></a>
+ <strong>AffineLayer:__init (id, global_conf, layer_conf)</strong>
+ </dt>
+ <dd>
+ The constructor.
+
+
+ <h3>Parameters:</h3>
+ <ul>
+ <li><span class="parameter">id</span>
+
+ </li>
+ <li><span class="parameter">global_conf</span>
+
+ </li>
+ <li><span class="parameter">layer_conf</span>
+
+ </li>
+ </ul>
+
+
+
+
+
+</dd>
+</dl>
+
+
+</div> <!-- id="content" -->
+</div> <!-- id="main" -->
+<div id="about">
+<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
+<i style="float:right;">Last updated 2016-01-15 14:56:30 </i>
+</div> <!-- id="about" -->
+</div> <!-- id="container" -->
+</body>
+</html>
diff --git a/nerv/doc/lua/modules/matrix.html b/nerv/doc/lua/modules/matrix.html
new file mode 100644
index 0000000..2840e59
--- /dev/null
+++ b/nerv/doc/lua/modules/matrix.html
@@ -0,0 +1,409 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<head>
+ <title>NERV documentation</title>
+ <link rel="stylesheet" href="../ldoc_pale.css" type="text/css" />
+</head>
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo"></div>
+ <div id="product_name"><big><b></b></big></div>
+ <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+
+<div id="main">
+
+
+<!-- Menu -->
+
+<div id="navigation">
+<br/>
+<h1>NERV</h1>
+
+<ul>
+ <li><a href="../index.html">Index</a></li>
+</ul>
+
+<h2>Contents</h2>
+<ul>
+<li><a href="#Class_nerv_Matrix">Class nerv.Matrix </a></li>
+<li><a href="#Class_nerv_CuMatrixFloat">Class nerv.CuMatrixFloat </a></li>
+<li><a href="#Class_nerv_CuMatrixDouble">Class nerv.CuMatrixDouble </a></li>
+<li><a href="#Class_nerv_MMatrix">Class nerv.MMatrix </a></li>
+</ul>
+
+
+<h2>Modules</h2>
+<ul class="$(kind=='Topics' and '' or 'nowrap'">
+ <li><a href="../modules/nerv.html">nerv</a></li>
+ <li><a href="../modules/layer.affine.html">layer.affine</a></li>
+ <li><strong>matrix</strong></li>
+</ul>
+
+</div>
+
+<div id="content">
+
+<h1>Module <code>matrix</code></h1>
+<p>Implements a fraction of matrix operations (methods) in Lua, while
+ others are implemented in C extension.</p>
+<p></p>
+ <h3>Info:</h3>
+ <ul>
+ <li><strong>Author</strong>: Ted Yin <ted.sybil@gmail.com></li>
+ </ul>
+
+
+<h2><a href="#Class_nerv_Matrix">Class nerv.Matrix </a></h2>
+<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#nerv.Matrix:__tostring__">nerv.Matrix:__tostring__ ()</a></td>
+ <td class="summary">Convert the matrix object to a string.</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.Matrix:generate">nerv.Matrix:generate (gen)</a></td>
+ <td class="summary">Assign each element in a matrix using the value returned by a callback <code>gen</code>.</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.Matrix:create">nerv.Matrix:create (nrow, ncol)</a></td>
+ <td class="summary">Create a fresh new matrix of the same matrix type (as <code>self</code>).</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.Matrix:__add__">nerv.Matrix:__add__ (b)</a></td>
+ <td class="summary">Operator overloading of <code>+</code>.</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.Matrix:__sub__">nerv.Matrix:__sub__ (b)</a></td>
+ <td class="summary">Operator overloading of <code>-</code>.</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.Matrix:__mul__">nerv.Matrix:__mul__ (b)</a></td>
+ <td class="summary">Operator overloading of <code>*</code>.</td>
+ </tr>
+</table>
+<h2><a href="#Class_nerv_CuMatrixFloat">Class nerv.CuMatrixFloat </a></h2>
+<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#nerv.CuMatrixFloat.new_from_host">nerv.CuMatrixFloat.new_from_host (mat)</a></td>
+ <td class="summary">Create a CUDA matrix copy of the host matrix (in memory)</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.CuMatrixFloat:new_to_host">nerv.CuMatrixFloat:new_to_host ()</a></td>
+ <td class="summary">Create a host matrix copy of the CUDA matrix</td>
+ </tr>
+</table>
+<h2><a href="#Class_nerv_CuMatrixDouble">Class nerv.CuMatrixDouble </a></h2>
+<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#nerv.CuMatrixDouble.new_from_host">nerv.CuMatrixDouble.new_from_host (mat)</a></td>
+ <td class="summary">Create a CUDA matrix copy of the host matrix (in memory)</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.CuMatrixDouble:new_to_host">nerv.CuMatrixDouble:new_to_host ()</a></td>
+ <td class="summary">Create a host matrix copy of the CUDA matrix</td>
+ </tr>
+</table>
+<h2><a href="#Class_nerv_MMatrix">Class nerv.MMatrix </a></h2>
+<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#nerv.MMatrix:copy_toh">nerv.MMatrix:copy_toh (b, ...)</a></td>
+ <td class="summary">A wrapper function for <code>copy_fromh</code></td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.MMatrix.print_profile">nerv.MMatrix.print_profile ()</a></td>
+ <td class="summary">Print profiling info of host matrices</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#nerv.MMatrix.clear_profile">nerv.MMatrix.clear_profile ()</a></td>
+ <td class="summary">Clear profiling info of host matrices</td>
+ </tr>
+</table>
+
+<br/>
+<br/>
+
+
+ <h2 class="section-header has-description"><a name="Class_nerv_Matrix"></a>Class nerv.Matrix </h2>
+
+ <div class="section-description">
+ The base class for all matrices.
+ </div>
+ <dl class="function">
+ <dt>
+ <a name = "nerv.Matrix:__tostring__"></a>
+ <strong>nerv.Matrix:__tostring__ ()</strong>
+ </dt>
+ <dd>
+ Convert the matrix object to a string.
+
+
+
+
+
+
+
+</dd>
+ <dt>
+ <a name = "nerv.Matrix:generate"></a>
+ <strong>nerv.Matrix:generate (gen)</strong>
+ </dt>
+ <dd>
+ Assign each element in a matrix using the value returned by a callback <code>gen</code>.
+
+
+ <h3>Parameters:</h3>
+ <ul>
+ <li><span clas