switched LSTM E2E test config to use TransposeTimes() for criteria
This commit is contained in:
Родитель
fab68641b0
Коммит
b78cd1383f
|
@ -436,11 +436,6 @@ public:
|
||||||
std::swap(dimsA[0], dimsA[1]);
|
std::swap(dimsA[0], dimsA[1]);
|
||||||
// update if LearnableParameter
|
// update if LearnableParameter
|
||||||
Input(0)->ValidateInferInputDimsFrom(TensorShape(dimsA));
|
Input(0)->ValidateInferInputDimsFrom(TensorShape(dimsA));
|
||||||
#if 0 // Removed this, because the check is just wrong.
|
|
||||||
// and verify once again
|
|
||||||
if (isFinalValidationPass && Input(0)->GetSampleLayout().GetDims() != dimsA)
|
|
||||||
InvalidArgument("%ls %ls operation: Left [%s] and right [%s] operands' shapes are not compatible.", NodeName().c_str(), OperationName().c_str(), dimsAstring.c_str(), dimsBstring.c_str());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,15 +140,15 @@ speechTrain = [
|
||||||
#ce = CrossEntropyWithSoftmax(labels, z, tag='criterion')
|
#ce = CrossEntropyWithSoftmax(labels, z, tag='criterion')
|
||||||
# ^^^ PROBABLY OUTDATED
|
# ^^^ PROBABLY OUTDATED
|
||||||
|
|
||||||
useExplicitCriterion = false
|
#ce = CrossEntropyWithSoftmax(labels, z, tag='criterion') // this is the objective, as a node
|
||||||
crNode = CrossEntropyWithSoftmax(labels, z) // this is the objective, as a node
|
#err = ErrorPrediction(labels, z, tag='evaluation') // this also gets tracked
|
||||||
crExplicit = -(ReduceSum (labels .* LogSoftmax (z))) // manually-defined per-sample objective
|
|
||||||
ce = Pass (if useExplicitCriterion then crExplicit else crNode, tag='criterion')
|
|
||||||
|
|
||||||
err = ErrorPrediction(labels, z, tag='evaluation') // this also gets tracked
|
# this shows how both CE and frame error rate can be constructed as BS expressions
|
||||||
|
ce = Pass (ReduceLogSum (z) - TransposeTimes (labels, z), tag='criterion') // manually-defined per-sample objective
|
||||||
|
err = Pass (BS.Constants.One - TransposeTimes (labels, Hardmax (z)), tag='evaluation') // also track frame errors
|
||||||
|
|
||||||
// decoding
|
// decoding
|
||||||
logPrior = LogPrior(labels)
|
logPrior = LogPrior(labels)
|
||||||
ScaledLogLikelihood = Pass (z - logPrior, tag='output') // using Pass() since we can't assign a tag to x - y
|
ScaledLogLikelihood = Pass (z - logPrior, tag='output') // using Pass() since we can't assign a tag to x - y
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче