Skip to content

Commit

Permalink
lstm: Remove unused constant and unused local variables
Browse files Browse the repository at this point in the history
This fixes three compiler warnings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jan 21, 2017
1 parent 134a253 commit 465e2de
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions lstm/lstmtrainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const int kNumPagesPerBatch = 100;
const int kMinStartedErrorRate = 75;
// Error rate at which to transition to stage 1.
const double kStageTransitionThreshold = 10.0;
// How often to test for flipping.
const int kFlipTestRate = 20;
// Confidence beyond which the truth is more likely wrong than the recognizer.
const double kHighConfidence = 0.9375; // 15/16.
// Fraction of weight sign-changing total to constitute a definite improvement.
Expand Down Expand Up @@ -856,7 +854,6 @@ Trainability LSTMTrainer::PrepareForBackward(const ImageData* trainingdata,
return UNENCODABLE;
}
targets->Resize(*fwd_outputs, network_->NumOutputs());
double text_error = 100.0;
LossType loss_type = OutputLossType();
if (loss_type == LT_SOFTMAX) {
if (!ComputeTextTargets(*fwd_outputs, truth_labels, targets)) {
Expand Down
1 change: 0 additions & 1 deletion lstm/networkio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ void NetworkIO::EnsureBestLabel(int t, int label) {
// remainder to best_label.
int num_classes = NumFeatures();
float* targets = f_[t];
float enhancement = (1.0f - targets[label]) / 3.0f;
for (int c = 0; c < num_classes; ++c) {
if (c == label) {
targets[c] += (1.0 - targets[c]) * (2 / 3.0);
Expand Down

0 comments on commit 465e2de

Please sign in to comment.