func printDebug(y [][]float64, machines []*ntm.NTM) { log.Printf("y: %+v", y) log.Printf("pred: %s", ntm.Sprint2(ntm.Predictions(machines))) n := machines[0].Controller.MemoryN() //outputT := len(machines) - (len(machines) - 2) / 2 outputT := 0 for t := outputT; t < len(machines); t++ { h := machines[t].Controller.Heads()[0] beta := math.Exp(*h.BetaVal()) g := ntm.Sigmoid(*h.GVal()) shift := math.Mod(2*ntm.Sigmoid(*h.SVal())-1+float64(n), float64(n)) gamma := math.Log(math.Exp(*h.GammaVal())+1) + 1 log.Printf("beta: %.3g(%v), g: %.3g(%v), s: %.3g(%v), gamma: %.3g(%v), erase: %+v, add: %+v, k: %+v", beta, *h.BetaVal(), g, *h.GVal(), shift, *h.SVal(), gamma, *h.GammaVal(), h.EraseVal(), h.AddVal(), h.KVal()) } }
func printDebug(y []int, machines []*ntm.NTM) { log.Printf("y: %+v", y) log.Printf("pred: %s", ntm.Sprint2(ntm.Predictions(machines))) }
func printDebug(x, y [][]float64, machines []*ntm.NTM) { log.Printf("x: %+v", x) log.Printf("y: %+v", y) log.Printf("pred: %s", ntm.Sprint2(ntm.Predictions(machines))) }