Created
June 9, 2022 13:02
-
-
Save zaleslaw/d14366591bade09eb56018d10f5505ec to your computer and use it in GitHub Desktop.
This file contains 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
val earlyStopping = EarlyStopping( | |
monitor = EpochTrainingEvent::valLossValue, | |
minDelta = 0.0, | |
patience = 2, | |
verbose = true, | |
mode = EarlyStoppingMode.AUTO, | |
baseline = 0.1, | |
restoreBestWeights = false | |
) | |
val terminateOnNaN = TerminateOnNaN() | |
class EvaluateCallback : Callback() { | |
override fun onTestBatchEnd(batch: Int, batchSize: Int, event: BatchEvent?, logs: History) { | |
println("Test batch $batch ends with loss ${event!!.lossValue}..") | |
} | |
override fun onTestEnd(logs: History) { | |
println("Train ends with last loss ${logs.lastBatchEvent().lossValue}") | |
} | |
} | |
class PredictCallback : Callback() { | |
override fun onPredictBatchBegin(batch: Int, batchSize: Int) { | |
println("Prediction batch $batch begins.") | |
} | |
override fun onPredictBatchEnd(batch: Int, batchSize: Int) { | |
println("Prediction batch $batch ends.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment