Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kaldi-commonvoice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Will
kaldi-commonvoice
Commits
7f8fb43e
Commit
7f8fb43e
authored
9 years ago
by
Dan Povey
Browse files
Options
Downloads
Patches
Plain Diff
nnet3: temporary commit
parent
ddaa1f3d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/nnet3/nnet-ctc-example.h
+105
-0
105 additions, 0 deletions
src/nnet3/nnet-ctc-example.h
src/nnet3/nnet-training.h
+2
-1
2 additions, 1 deletion
src/nnet3/nnet-training.h
with
107 additions
and
1 deletion
src/nnet3/nnet-ctc-example.h
0 → 100644
+
105
−
0
View file @
7f8fb43e
// nnet3/nnet-ctcexample.h
// Copyright 2015 Johns Hopkins University (author: Daniel Povey)
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#ifndef KALDI_NNET3_NNET_CTC_EXAMPLE_H_
#define KALDI_NNET3_NNET_CTC_EXAMPLE_H_
#include
"nnet3/nnet-nnet.h"
#include
"hmm/posterior.h"
#include
"util/table-types.h"
#include
"lat/kaldi-lattice.h"
#include
"hmm/posterior.h"
#include
"thread/kaldi-semaphore.h"
namespace
kaldi
{
namespace
nnet3
{
struct
NnetIo
{
/// the name of the input in the neural net; in simple setups it
/// will just be "input".
std
::
string
name
;
/// "indexes" is a vector the same length as features.NumRows(), explaining
/// the meaning of each row of the "features" matrix. Note: the "n" values
/// in the indexes will always be zero in individual examples, but in general
/// nonzero after we aggregate the examples into the minibatch level.
std
::
vector
<
Index
>
indexes
;
/// The features or labels. GeneralMatrix may contain either a CompressedMatrix,
/// a Matrix, or SparseMatrix (a SparseMatrix would be the natural format for posteriors).
GeneralMatrix
features
;
/// This constructor creates NnetIo with name "name", indexes with n=0, x=0,
/// and t values ranging from t_begin to t_begin + feats.NumRows() - 1, and
/// the provided features. t_begin should be the frame that feats.Row(0)
/// represents.
NnetIo
(
const
std
::
string
&
name
,
int32
t_begin
,
const
MatrixBase
<
BaseFloat
>
&
feats
);
/// This constructor sets "name" to the provided string, sets "indexes" with
/// n=0, x=0, and t from t_begin to t_begin + labels.size() - 1, and the labels
/// as provided. t_begin should be the frame to which labels[0] corresponds.
NnetIo
(
const
std
::
string
&
name
,
int32
dim
,
int32
t_begin
,
const
Posterior
&
labels
);
NnetIo
()
{
}
// Use default copy constructor and assignment operators.
void
Write
(
std
::
ostream
&
os
,
bool
binary
)
const
;
void
Read
(
std
::
istream
&
is
,
bool
binary
);
};
/// NnetExample is the input data and corresponding label (or labels) for one or
/// more frames of input, used for standard cross-entropy training of neural
/// nets (and possibly for other objective functions).
struct
NnetExample
{
/// "io" contains the input and output. In principle there can be multiple
/// types of both input and output, with different names. The order is
/// irrelevant.
std
::
vector
<
NnetIo
>
io
;
void
Write
(
std
::
ostream
&
os
,
bool
binary
)
const
;
void
Read
(
std
::
istream
&
is
,
bool
binary
);
NnetExample
()
{
}
NnetExample
(
const
NnetExample
&
other
)
:
io
(
other
.
io
)
{
}
void
Swap
(
NnetExample
*
other
)
{
io
.
swap
(
other
->
io
);
}
/// Compresses any features that are not sparse.
void
Compress
();
};
typedef
TableWriter
<
KaldiObjectHolder
<
NnetExample
>
>
NnetExampleWriter
;
typedef
SequentialTableReader
<
KaldiObjectHolder
<
NnetExample
>
>
SequentialNnetExampleReader
;
typedef
RandomAccessTableReader
<
KaldiObjectHolder
<
NnetExample
>
>
RandomAccessNnetExampleReader
;
}
// namespace nnet3
}
// namespace kaldi
#endif // KALDI_NNET3_NNET_EXAMPLE_H_
This diff is collapsed.
Click to expand it.
src/nnet3/nnet-training.h
+
2
−
1
View file @
7f8fb43e
...
...
@@ -90,7 +90,8 @@ struct ObjectiveFunctionInfo {
// This function updates the stats and, if the phase has just changed,
// prints a message indicating progress. The phase equals
// minibatch_counter / minibatches_per_phase.
// minibatch_counter / minibatches_per_phase. Its only function is to
// control how frequently we print logging messages.
void
UpdateStats
(
const
std
::
string
&
output_name
,
int32
minibatches_per_phase
,
int32
minibatch_counter
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment