Skip to content

Commit 0c9235e

Browse files
committed
Fix typos in new LSTM code
All of them were found and fixed by codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent a7d2758 commit 0c9235e

9 files changed

+11
-11
lines changed

lstm/lstmrecognizer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class LSTMRecognizer {
209209
// If label_threshold is positive, uses it for making the labels, otherwise
210210
// uses standard ctc. Returned in scale_factor is the reduction factor
211211
// between the image and the output coords, for computing bounding boxes.
212-
// If re_invert is true, the input is inverted back to its orginal
212+
// If re_invert is true, the input is inverted back to its original
213213
// photometric interpretation if inversion is attempted but fails to
214214
// improve the results. This ensures that outputs contains the correct
215215
// forward outputs for the best photometric interpretation.
@@ -351,7 +351,7 @@ class LSTMRecognizer {
351351
// The unicharset. Only the unicharset element is serialized.
352352
// Has to be a CCUtil, so Dict can point to it.
353353
CCUtil ccutil_;
354-
// For backward compatability, recoder_ is serialized iff
354+
// For backward compatibility, recoder_ is serialized iff
355355
// training_flags_ & TF_COMPRESS_UNICHARSET.
356356
// Further encode/decode ccutil_.unicharset's ids to simplify the unicharset.
357357
UnicharCompress recoder_;

lstm/recodebeam.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct RecodeNode {
9191
bool start_of_word;
9292
// True if this represents a valid candidate end of word position. Does not
9393
// necessarily mark the end of a word, since a word can be extended beyond a
94-
// candidiate end by a continuation, eg 'the' continues to 'these'.
94+
// candidate end by a continuation, eg 'the' continues to 'these'.
9595
bool end_of_word;
9696
// True if this is a duplicate of prev in all respects. Some training modes
9797
// allow the network to output duplicate characters and crush them with CTC,

lstm/series.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ bool Series::Backward(bool debug, const NetworkIO& fwd_deltas,
142142
}
143143

144144
// Splits the series after the given index, returning the two parts and
145-
// deletes itself. The first part, upto network with index last_start, goes
145+
// deletes itself. The first part, up to network with index last_start, goes
146146
// into start, and the rest goes into end.
147147
void Series::SplitAt(int last_start, Series** start, Series** end) {
148148
*start = NULL;

lstm/series.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Series : public Plumbing {
7777
NetworkIO* back_deltas);
7878

7979
// Splits the series after the given index, returning the two parts and
80-
// deletes itself. The first part, upto network with index last_start, goes
80+
// deletes itself. The first part, up to network with index last_start, goes
8181
// into start, and the rest goes into end.
8282
void SplitAt(int last_start, Series** start, Series** end);
8383

lstm/static_shape.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum LossType {
3232
};
3333

3434
// Simple class to hold the tensor shape that is known at network build time
35-
// and the LossType of the loss funtion.
35+
// and the LossType of the loss function.
3636
class StaticShape {
3737
public:
3838
StaticShape()

lstm/stridemap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool StrideMap::Index::IsLast(FlexDimensions dimension) const {
3838
return MaxIndexOfDim(dimension) == indices_[dimension];
3939
}
4040

41-
// Given that the dimensions upto and including dim-1 are valid, returns the
41+
// Given that the dimensions up to and including dim-1 are valid, returns the
4242
// maximum index for dimension dim.
4343
int StrideMap::Index::MaxIndexOfDim(FlexDimensions dim) const {
4444
int max_index = stride_map_->shape_[dim] - 1;

lstm/stridemap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class StrideMap {
6969
bool IsValid() const;
7070
// Returns true if the index of the given dimension is the last.
7171
bool IsLast(FlexDimensions dimension) const;
72-
// Given that the dimensions upto and including dim-1 are valid, returns the
72+
// Given that the dimensions up to and including dim-1 are valid, returns the
7373
// maximum index for dimension dim.
7474
int MaxIndexOfDim(FlexDimensions dim) const;
7575
// Adds the given offset to the given dimension. Returns true if the result

lstm/weightmatrix.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const int kDoubleFlag = 128;
163163

164164
// Writes to the given file. Returns false in case of error.
165165
bool WeightMatrix::Serialize(bool training, TFile* fp) const {
166-
// For backward compatability, add kDoubleFlag to mode to indicate the doubles
166+
// For backward compatibility, add kDoubleFlag to mode to indicate the doubles
167167
// format, without errs, so we can detect and read old format weight matrices.
168168
uinT8 mode = (int_mode_ ? kInt8Flag : 0) |
169169
(use_ada_grad_ ? kAdaGradFlag : 0) | kDoubleFlag;
@@ -202,7 +202,7 @@ bool WeightMatrix::DeSerialize(bool training, bool swap, TFile* fp) {
202202
}
203203

204204
// As DeSerialize, but reads an old (float) format WeightMatrix for
205-
// backward compatability.
205+
// backward compatibility.
206206
bool WeightMatrix::DeSerializeOld(bool training, bool swap, TFile* fp) {
207207
GENERIC_2D_ARRAY<float> float_array;
208208
if (int_mode_) {

lstm/weightmatrix.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class WeightMatrix {
100100
// If swap is true, assumes a big/little-endian swap is needed.
101101
bool DeSerialize(bool training, bool swap, TFile* fp);
102102
// As DeSerialize, but reads an old (float) format WeightMatrix for
103-
// backward compatability.
103+
// backward compatibility.
104104
bool DeSerializeOld(bool training, bool swap, TFile* fp);
105105

106106
// Computes matrix.vector v = Wu.

0 commit comments

Comments
 (0)