[Swift-commit] r5565 - SwiftApps/SciColSim

jonmon at ci.uchicago.edu jonmon at ci.uchicago.edu
Wed Feb 8 13:47:41 CST 2012


Author: jonmon
Date: 2012-02-08 13:47:40 -0600 (Wed, 08 Feb 2012)
New Revision: 5565

Modified:
   SwiftApps/SciColSim/annealing.swift
Log:
parameterized the seed



Modified: SwiftApps/SciColSim/annealing.swift
===================================================================
--- SwiftApps/SciColSim/annealing.swift	2012-02-08 14:22:28 UTC (rev 5564)
+++ SwiftApps/SciColSim/annealing.swift	2012-02-08 19:47:40 UTC (rev 5565)
@@ -70,7 +70,7 @@
 
     Res mlres[][];
 
-    mlres[0][0] = multi_loss( 0, 0, params0, target_innov, evolve_reruns ); // FIXME: serves for all evolve-params ???
+    mlres[0][0] = multi_loss( T_start, T_end, annealing_cycles, Target_rejection, starting_jump, 0, 0, params0, target_innov, evolve_reruns ); // FIXME: serves for all evolve-params ???
     tracef( "multi_annealing: AR: initial: %f +- %f\n", mlres[0][0].loss, mlres[0][0].sdev );
 
     foreach j in [0:NEVOPARAMS-1]
@@ -151,8 +151,10 @@
                     }
                 }
                 tracef( @strcat( "multi_annealing: AR: ", color( 10,"%f" ), " ", color( 9,"%i" ),"\n" ), try_x[j], j );
+
                 // Up to here, x[] and dx[] are only set for previous i
-                mlres[i][j] = multi_loss( i, j, try_x, target_innov, evolve_reruns ); // do the N evolve()'s, N=evolve_reruns
+                mlres[i][j] = multi_loss( T_start, T_end, annealing_cycles, Target_rejection, starting_jump, i, j, try_x, target_innov, evolve_reruns ); // do the N evolve()'s, N=evolve_reruns
+
                 tracef( "multi_annealing: AR: %f +- %f\n", mlres[i][j].loss, mlres[i][j].sdev );
                 // Beyond this point, x[] and dx[] are being set for this i,j
 
@@ -160,7 +162,7 @@
 
                 if ( mlres[i][j].loss < ALOT )
                 {
-                    fprintf( "best_opt_some_swift.txt", "%f,%f,%f,%f,%f,%f,%f,%f\n",
+                    fprintf( "best_opt_some_swift.txt", "%f, %f, %f, %f, %f, %f, %f, %f\n",
                            target_innov, mlres[i][j].loss, try_x[0], try_x[1], try_x[2], try_x[3], try_x[4], mlres[i][j].sdev );
                     fprintf( "max_dist_swift.txt", color( Red,"multi_annealing: AF: max_dist.txt - tbd\n" ) ); // FIXME: max_dist is global set in evolve()
                 }
@@ -226,9 +228,9 @@
     } until( iter_i == (annealing_cycles-1) );
 }
 
-(Res r) multi_loss( int ci, int cj, float x[], float target_innov, int evolve_reruns )
-// (Res r, Stats s) multi_loss( int ci, int cj, float x[], float target_innov, int evolve_reruns ) FIXME: To obtain stats
+(Res r) multi_loss( float t_start, float t_end, int annealing_steps, float t_rejection, float starting_jump, int ci, int cj, float x[], float target_innov, int evolve_reruns )
 {
+    tracef("%q\n", x);
     file rfile[];
     file ofile[]; // FIXME: to obtain timings and otehr stats
 
@@ -242,29 +244,28 @@
     {  // repeats of the evolove() - same as n_reruns
         file outfile; // FIXME: map and save in future
         string args[] = [ // FIXME: move this to a setargs() function
-            //    alpha_i        alpha_m        beta           gamma          delta          target_innov
-            @strcat(x[0]), @strcat(x[1]), @strcat(x[2]), @strcat(x[3]), @strcat(x[4]), @strcat(target_innov),
+            //    alpha_i           alpha_m        beta           gamma          delta          target_innov
+                 @strcat(x[0]),  @strcat(x[1]), @strcat(x[2]), @strcat(x[3]), @strcat(x[4]), @strcat(target_innov),
 
-            //     n_epochs n_steps evolve_reruns           range
-            //    "40000",  "20",   @strcat(evolve_reruns), "2",
-            "40000",  "20",   @strcat(rerunsPerApp),  "2",
+            //     n_epochs n_steps   evolve_reruns           range
+            //    "40000",   "20",  @strcat(evolve_reruns),    "2",
+                  "40000",   "20",  @strcat(rerunsPerApp),     "2",
 
             //    verbose_level
-            "1",
+                    "1",
 
-            //    T_start T_end   Annealing_steps Target_rejection Starting_jump
-            "2.",   "0.01", "2",            "0.3",           "2.3",
+            //    T_start             T_end          Annealing_steps         Target_rejection         Starting_jump
+                 @strcat(t_start), @strcat(t_end), @strcat(annealing_steps), @strcat(t_rejection), @strcat(starting_jump),
 
             //    FREEZE: alpha_i alpha_m beta gamma delta
             "1",    "1",    "0", "0",  "0",
 
-            //   operation-code:(m,a) Nworkers           seed
-            "m",                 @strcat(Nworkers), "1234567" ];
+            //   operation-code:(m,a)    Nworkers           seed
+                      "m",            @strcat(Nworkers), @arg("seed", "0" ) ];
 
         file graph <"movie_graph.txt">;
 
         ( outfile, rfile[i] ) = evolve( args, graph );
-        // (ofile[i], rfile[i]) = evolve(args,graph);
 
         tracef("multi_loss: i=%i calling evolve, args=%q\n", i, args);
         // tracef("multi_loss: after evolve: i=%i %k %k\n", i, outfile, rfile[i]);




More information about the Swift-commit mailing list