forked from microsoft/CNTK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated beam decoder to new structure
- Loading branch information
1 parent
239633b
commit b0bca78
Showing
4 changed files
with
81 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# TODO: must sort this out. For now, this is just shared stuff between training and decoding. | ||
|
||
# these depend on beamDepth parameter for now, fix this | ||
TraceState (h, what) = | ||
if enableTracing | ||
then Transpose (Trace (Transpose (h), say=what, logFirst=10, logFrequency=traceFrequency, logGradientToo=false, onlyUpToRow=beamDepth*beamDepth, onlyUpToT=3, format=formatDense)) | ||
else h | ||
TraceDense (h, what) = | ||
if enableTracing | ||
then Trace (h, say=what, logFirst=10, logFrequency=traceFrequency, logGradientToo=false, onlyUpToRow=beamDepth*beamDepth, onlyUpToT=25, format=formatDense) | ||
else h | ||
TraceOneHot (h, what) = | ||
if enableTracing | ||
then Trace (h, say=what, logFirst=10, logFrequency=traceFrequency, logGradientToo=false, /*onlyUpToRow=beamDepth*beamDepth, onlyUpToT=15,*/ format=formatOneHot) | ||
else h | ||
TraceSparse (h, what) = | ||
if enableTracing | ||
then Trace (h, say=what, logFirst=10, logFrequency=traceFrequency, logGradientToo=false, /*onlyUpToRow=beamDepth*beamDepth, onlyUpToT=3,*/ format=formatSparse) | ||
else h | ||
|
||
Trace (node, say='', logFrequency=traceFrequency, logFirst=10, logGradientToo=false, onlyUpToRow=100000000, onlyUpToT=100000000, format=[], tag='') = new ComputationNode [ | ||
operation = 'Trace' ; inputs = node | ||
] | ||
|
||
formatDense = [ | ||
type = "real" | ||
transpose = false | ||
precisionFormat = ".4" | ||
] | ||
formatOneHot = [ | ||
type = "category" | ||
transpose = false | ||
labelMappingFile = tracingLabelMappingFile | ||
] | ||
formatSparse = [ | ||
type = "sparse" | ||
transpose = false | ||
labelMappingFile = tracingLabelMappingFile | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters