func main() { flag.Parse() //defer profile.Start(profile.CPUProfile).Stop() if *Phased { fmt.Println("Using phased mutator") } else { fmt.Println("Using complexifying-only mutator") } fmt.Println("Each trial will run for a maximum of", *Duration, "minutes.") if err := trials.Run(func(i int) (*neat.Experiment, error) { eval := &Evaluator{stopTime: time.Now().Add(time.Minute * time.Duration(*Duration))} var ctx *starter.Context if *Phased { ctx = starter.NewContext(eval, func(ctx *starter.Context) { ctx.SetMutator(mutator.NewComplete(ctx, ctx, ctx, ctx, ctx, ctx)) }) } else { ctx = starter.NewContext(eval) } if exp, err := starter.NewExperiment(ctx, ctx, i); err != nil { return nil, err } else { return exp, nil } }); err != nil { log.Fatal("Could not run OCR: ", err) } }
func hyperneatContext() *starter.Context { cfg := initSettings() cfg.ExperimentName = "HyperNEAT" cfg.ArchivePath = "./proof-out/hyperneat" cfg.ArchiveName = "hyperneat" cfg.WebPath = cfg.ArchivePath cfg.MutateActivationProbability = 0.25 cfg.OutputActivation = neat.Tanh cfg.NumInputs = 4 cfg.NumOutputs = 2 ctx := starter.NewContext(&NEATEval{}, func(ctx *starter.Context) { ctx.SetMutator(mutator.NewComplete(ctx, ctx, ctx, ctx, ctx, ctx)) ctx.SetDecoder(&decoder.HyperNEAT{CppnDecoder: decoder.Classic{}, HyperNEATSettings: hyperneatSettings(ctx)}) }) ctx.Settings = cfg return ctx }