Created
October 19, 2018 11:50
-
-
Save koen-dejonghe/93928e934d8157ecebb4b7391c039d91 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def endPoint(y: Variable): Receive = { | |
case Forward(yHat) => | |
val l = loss(yHat, y) | |
l.backward() | |
wire.prev ! Backward(yHat.grad) | |
trainingLoss += l.data.squeeze() | |
if (trainingDataIterator.hasNext) { | |
context become startPoint(TrainingDataIterator.next()) | |
} else { | |
endOfEpoch() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment