From 2a9983a1407fcafe5cca5d78e2bb1d3bced3ed00 Mon Sep 17 00:00:00 2001 From: qcgm1978 Date: Mon, 30 May 2016 16:03:20 +0800 Subject: [PATCH 1/5] basic demo added --- demo/start.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 demo/start.html diff --git a/demo/start.html b/demo/start.html new file mode 100644 index 00000000..8aeb2b61 --- /dev/null +++ b/demo/start.html @@ -0,0 +1,29 @@ + + + + + + + +
+ + + + \ No newline at end of file From fdec44c20da2d6156a84aa9217739b430f64c55a Mon Sep 17 00:00:00 2001 From: qcgm1978 Date: Mon, 30 May 2016 17:50:01 +0800 Subject: [PATCH 2/5] gulp integration --- Gulpfile.js | 62 +++++++++++++++++++++++++++++++++ bower.json | 2 +- demo/{start.html => index.html} | 2 +- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 Gulpfile.js rename demo/{start.html => index.html} (96%) diff --git a/Gulpfile.js b/Gulpfile.js new file mode 100644 index 00000000..4a2ee06c --- /dev/null +++ b/Gulpfile.js @@ -0,0 +1,62 @@ +var gulp = require('gulp'); +var jshint = require('gulp-jshint'); +//var lrserver = require('tiny-lr'); +//var livereload = require('gulp-livereload'); +//var connect = require('connect'); +var browserSync = require('browser-sync'); +const reload = browserSync.reload; + +// Edit this values to best suit your app +var WEB_PORT = 9000; +var APP_DIR = 'demo'; +// jshint files +gulp.task('jshint', function () { + //gulp.src(['test/**/*.js']) + // .pipe(jshint()) + // .pipe(jshint.reporter()); +}); +//var lrs = lrserver(); +// start livereload server +gulp.task('lr-server', function () { + //lrs.listen(35729, function (err) { + // if (err) return console.log(err); + //}); +}); +// start local http server for development +gulp.task('http-server', function () { + browserSync({ + notify: false, + // Customize the Browsersync console logging prefix + logPrefix: 'WSK', + // Allow scroll syncing across breakpoints + scrollElementMapping: ['main', '.mdl-layout'], + // Run as an https by uncommenting 'https: true' + // Note: this uses an unsigned certificate which on first access + // will present a certificate warning in the browser. + // https: true, + server: ['.tmp', 'demo'], + port: 3000 + }); + gulp.watch(['demo/**/*'], reload); + + //connect() + //.use(require('connect-livereload')()) + //.use(connect.static(APP_DIR)) + //.listen(WEB_PORT); + console.log('Server listening on http://localhost:' + WEB_PORT); +}); +// start local http server with watch and livereload set up +gulp.task('server', function () { + //gulp.run('lr-server'); + //var watchFiles = ['demo/**/*.html', 'demo/js/**/*.js']; + //gulp.watch(watchFiles, function (e) { + // console.log('Files changed. Reloading...'); + // gulp.src(watchFiles) + // .pipe(livereload(lrs)); + //}); + gulp.run('http-server'); +}); +gulp.task('default', function () { + gulp.run('jshint', 'server'); +}); + diff --git a/bower.json b/bower.json index 6158a6d8..0937ccb2 100644 --- a/bower.json +++ b/bower.json @@ -28,4 +28,4 @@ "test", "tests" ] -} +} \ No newline at end of file diff --git a/demo/start.html b/demo/index.html similarity index 96% rename from demo/start.html rename to demo/index.html index 8aeb2b61..58bfdaea 100644 --- a/demo/start.html +++ b/demo/index.html @@ -6,7 +6,7 @@
- + - - - - - - - + ConvNetJS demo: Classify toy 2D data + + + + + + + + + + +
-

ConvnetJS demo: toy 1d regression

+

ConvnetJS demo: toy 1d regression

-

The simulation below is a 1-dimensional regression where a neural network is trained to regress to y coordinates for every given point x through an L2 loss. That is, the minimized cost function computes the squared difference between the predicted y-coordinate and the "correct" y coordinate. Every 10th of a second, all points are fed to the network multiple times through the trainer class to train the network.

+

The simulation below is a 1-dimensional regression where a neural network is trained to regress to y coordinates + for every given point x through an L2 loss. That is, the minimized cost function computes the squared difference + between the predicted y-coordinate and the "correct" y coordinate. Every 10th of a second, all points are fed to + the network multiple times through the trainer class to train the network.

-

The simulation below will eval() whatever you have in the text area and reload. Feel free to explore and use ConvNetJS to instantiate your own network!

+

The simulation below will eval() whatever you have in the text area and reload. Feel free to explore and use + ConvNetJS to instantiate your own network!

-

Report questions/bugs/suggestions to @karpathy.

+

Report questions/bugs/suggestions to @karpathy.

-

- + +

+ -
-Number of points to generate: - -
+
+ Number of points to generate: + +
+ +
+ +

Add data points by clicking!

+
+ + Also draw outputs of a layer (click layer button below) in red. +
-
-

Add data points by clicking!

-
- -Also draw outputs of a layer (click layer button below) in red. -
+
-Browser not supported for Canvas. Get a real browser. + Browser not supported for Canvas. Get a real browser. -

Go back to ConvNetJS

+

Go back to ConvNetJS

diff --git a/demo/rldemo.html b/demo/rldemo.html index dac859f8..bbd9b968 100644 --- a/demo/rldemo.html +++ b/demo/rldemo.html @@ -54,37 +54,38 @@

Q-Learner full specification and options

@@ -145,5 +146,13 @@

I/O


+ + + +