Closed shrutiramesh88 closed 8 years ago
You could use an actuator that prints values to the console. E.g.:
// imports needed for our actuator definition
import libcog.{ScalarFieldReader, Actuator}
val cg = new ComputeGraph {
...
var correct = CorrectCount(d4.forward, label.forward, batchSize, 0.01f) / batchSize
var avgCorrect = NormalizedLowPass(correct, 0.001f)
def printToConsole(prefix: String)(data: ScalarFieldReader): Unit = {
// assumes there is exactly one scalar value in 'data'
println(prefix+data.read())
}
val correctPrinter = Actuator(correct, printToConsole("correct: ")(_))
val avgCorrectPrinter = Actuator(avgCorrect, printToConsole("avgCorrect: ")(_))
...
}
This will print the values of the 'correct' and 'avgCorrect' fields on every model tick.
val cg = new ComputeGraph(optimize=false){ ... var correct = CorrectCount(d4.forward, label.forward, batchSize, 0.01f) / batchSize var avgCorrect = NormalizedLowPass(correct, 0.001f) ... } I want to print the correct and avgCorrect values