private static Thread train_network_in_thread(Network net, Data d, float[] err) { var ptr = new TrainArgs { Net = net, D = d, Err = err }; var thread = new Thread(() => { train_thread(ptr); }); thread.Start(); return(thread); }
private static void train_thread(TrainArgs ptr) { ptr.Err[0] = train_network(ptr.Net, ptr.D); }