From 5c018e6065d415183b23ed1d68bb4092e0bd89ea Mon Sep 17 00:00:00 2001 From: cloudygoose Date: Wed, 3 Jun 2015 18:30:38 +0800 Subject: doc change for matrix --- doc/nerv_matrix.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/nerv_matrix.md b/doc/nerv_matrix.md index ef5118e..2edf691 100644 --- a/doc/nerv_matrix.md +++ b/doc/nerv_matrix.md @@ -82,4 +82,10 @@ Calculate element-wise multiplication of __Matrix__ `ma` and `mb`, store the res * __void Matrix.log_elem(Matrix self, Matrix ma)__ Calculate element-wise log of __Matrix__ `ma`, store the result in `self`. * __void Matrix.copy_rows_fromh_by_idx(Matrix self, MMatrix ma, MMatrixInt idx)__ -`idx` should be a row vector. This function copy the rows of `ma` to `self` according to `idx`, in other words, it assigns `ma[idx[i]]` to `self[i]`. \ No newline at end of file +`idx` should be a row vector. This function copy the rows of `ma` to `self` according to `idx`, in other words, it assigns `ma[idx[i]]` to `self[i]`. +* __void Matrix.expand_frm(Matrix self, Matrix a, int context)__ +Treating each row of `a` as speech feature, and do a feature expansion. The `self` should of size `(a.nrow, a.ncol * (context * 2 + 1))`. `self[i]` will be `(a[i-context] a[i-context+1] ... a[i] a[i+1] a[i+context])`. `a[0]` and `a[nrow]` will be copied to extend the index range. +* __void Matrix.rearrange_frm(Matrix self, Matrix a, int step)__ +Rearrange `a` according to its feature dimension. The `step` is the length of context. So, `self[i][j]` will be assigned `a[i][j / step + (j % step) * (a.ncol / step)]`. `a` and `self` should be of the same size and `step` should be divisible by `a.ncol`. +* __void Matrix.scale_row(Matrix self, Matrix scale)__ +Scale each column of `self` according to a vector `scale`. `scale` should be of size `1 * self.ncol`. \ No newline at end of file -- cgit v1.2.3