Commits

Olivier Grisel committed 262f72c

fix style + train a model by default

Comments (0)

Files changed (1)

experiments/xp_movie_prediction.py

 from gumby.adapter.movie import Movie
 from gumby.adapter.movie import load_movie
 from gumby.adapter.movie import MovieAdapter
+from pysgd import SvmModel
 
 import logging
 logging.config.fileConfig("log.ini")
         #ma.plot_mse_gain_over_identity("gain_mse.png")
 
     end_generation = time.time()
-    log.info("generated %d frames in %03fs", BATCH_SIZE, end_generation-start)
+    log.info("generated %d frames in %03fs",
+             BATCH_SIZE, end_generation - start)
 
     # dump the data set on disk so as to be able to quickly reuse it later
     # without going through brain adapting again
 
     end_conversion = time.time()
     log.info("converted %d frames to %d training points in %03fs",
-             BATCH_SIZE, len(i), end_conversion-end_generation)
+             BATCH_SIZE, len(i), end_conversion - end_generation)
 
     print "saving " + INPUTS_FILENAME
     dump(i, file(INPUTS_FILENAME, 'wb'))
     log.info("loaded %d frames in %0.3fs", len(i),
              time.time() - start)
 
-
+m = SvmModel()
+m.train(i, o)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.