Skip to content

Commit

Permalink
Add GruNonlinearityComponent(by Dan) and OutputGruNonlinearityCompone…
Browse files Browse the repository at this point in the history
…nt; moving aroun some sources in nnet3 to avoid very large files

small fix
  • Loading branch information
LvHang committed Sep 18, 2018
1 parent 2cfcfda commit 5836b9b
Show file tree
Hide file tree
Showing 9 changed files with 4,528 additions and 1,826 deletions.
1,054 changes: 1,053 additions & 1 deletion egs/wsj/s5/steps/libs/nnet3/xconfig/gru.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions egs/wsj/s5/steps/libs/nnet3/xconfig/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
'opgru-layer' : xlayers.XconfigOpgruLayer,
'norm-pgru-layer' : xlayers.XconfigNormPgruLayer,
'norm-opgru-layer' : xlayers.XconfigNormOpgruLayer,
'fast-gru-layer' : xlayers.XconfigFastPgruLayer,
'fast-pgru-layer' : xlayers.XconfigFastPgruLayer,
'fast-norm-pgru-layer' : xlayers.XconfigFastNormPgruLayer,
'fast-opgru-layer' : xlayers.XconfigFastOPgruLayer,
'fast-norm-opgru-layer' : xlayers.XconfigFastNormOPgruLayer,
'tdnnf-layer': xlayers.XconfigTdnnfLayer,
'prefinal-layer': xlayers.XconfigPrefinalLayer,
'renorm-component': xlayers.XconfigRenormComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/nnet3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TESTFILES = natural-gradient-online-test nnet-graph-test \
nnet-common-test convolution-test attention-test

OBJFILES = nnet-common.o nnet-compile.o nnet-component-itf.o \
nnet-simple-component.o nnet-normalize-component.o \
nnet-simple-component.o nnet-special-component.o nnet-normalize-component.o \
nnet-general-component.o nnet-parse.o natural-gradient-online.o \
nnet-descriptor.o nnet-optimize.o nnet-computation.o \
nnet-computation-graph.o nnet-graph.o am-nnet-simple.o \
Expand Down
5 changes: 5 additions & 0 deletions src/nnet3/nnet-component-itf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <iomanip>
#include "nnet3/nnet-component-itf.h"
#include "nnet3/nnet-simple-component.h"
#include "nnet3/nnet-special-component.h"
#include "nnet3/nnet-normalize-component.h"
#include "nnet3/nnet-general-component.h"
#include "nnet3/nnet-convolutional-component.h"
Expand Down Expand Up @@ -178,6 +179,10 @@ Component* Component::NewComponentOfType(const std::string &component_type) {
ans = new RestrictedAttentionComponent();
} else if (component_type == "SumBlockComponent") {
ans = new SumBlockComponent();
} else if (component_type == "GruNonlinearityComponent") {
ans = new GruNonlinearityComponent();
} else if (component_type == "OutputGruNonlinearityComponent") {
ans = new OutputGruNonlinearityComponent();
} else if (component_type == "ScaleAndOffsetComponent") {
ans = new ScaleAndOffsetComponent();
}
Expand Down
Loading

0 comments on commit 5836b9b

Please sign in to comment.