Skip to content

Commit 82c2b1c

Browse files
committed
Add GruNonlinearityComponent(by Dan) and OutputGruNonlinearityComponent; moving aroun some sources in nnet3 to avoid very large files
1 parent 2cfcfda commit 82c2b1c

File tree

9 files changed

+4518
-1826
lines changed

9 files changed

+4518
-1826
lines changed

egs/wsj/s5/steps/libs/nnet3/xconfig/gru.py

Lines changed: 1052 additions & 1 deletion
Large diffs are not rendered by default.

egs/wsj/s5/steps/libs/nnet3/xconfig/parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
'opgru-layer' : xlayers.XconfigOpgruLayer,
6969
'norm-pgru-layer' : xlayers.XconfigNormPgruLayer,
7070
'norm-opgru-layer' : xlayers.XconfigNormOpgruLayer,
71+
'fast-gru-layer' : xlayers.XconfigFastPgruLayer,
72+
'fast-pgru-layer' : xlayers.XconfigFastPgruLayer,
73+
'fast-norm-pgru-layer' : xlayers.XconfigFastNormPgruLayer,
74+
'fast-opgru-layer' : xlayers.XconfigFastOPgruLayer,
75+
'fast-norm-opgru-layer' : xlayers.XconfigFastNormOPgruLayer,
7176
'tdnnf-layer': xlayers.XconfigTdnnfLayer,
7277
'prefinal-layer': xlayers.XconfigPrefinalLayer,
7378
'renorm-component': xlayers.XconfigRenormComponent,

src/nnet3/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TESTFILES = natural-gradient-online-test nnet-graph-test \
1515
nnet-common-test convolution-test attention-test
1616

1717
OBJFILES = nnet-common.o nnet-compile.o nnet-component-itf.o \
18-
nnet-simple-component.o nnet-normalize-component.o \
18+
nnet-simple-component.o nnet-special-component.o nnet-normalize-component.o \
1919
nnet-general-component.o nnet-parse.o natural-gradient-online.o \
2020
nnet-descriptor.o nnet-optimize.o nnet-computation.o \
2121
nnet-computation-graph.o nnet-graph.o am-nnet-simple.o \

src/nnet3/nnet-component-itf.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <iomanip>
2424
#include "nnet3/nnet-component-itf.h"
2525
#include "nnet3/nnet-simple-component.h"
26+
#include "nnet3/nnet-special-component.h"
2627
#include "nnet3/nnet-normalize-component.h"
2728
#include "nnet3/nnet-general-component.h"
2829
#include "nnet3/nnet-convolutional-component.h"
@@ -178,6 +179,10 @@ Component* Component::NewComponentOfType(const std::string &component_type) {
178179
ans = new RestrictedAttentionComponent();
179180
} else if (component_type == "SumBlockComponent") {
180181
ans = new SumBlockComponent();
182+
} else if (component_type == "GruNonlinearityComponent") {
183+
ans = new GruNonlinearityComponent();
184+
} else if (component_type == "OutputGruNonlinearityComponent") {
185+
ans = new OutputGruNonlinearityComponent();
181186
} else if (component_type == "ScaleAndOffsetComponent") {
182187
ans = new ScaleAndOffsetComponent();
183188
}

0 commit comments

Comments
 (0)