-
Notifications
You must be signed in to change notification settings - Fork 948
Fix demos and models #461
Fix demos and models #461
Conversation
Reviewed 23 of 27 files at r1, 19 of 19 files at r2, 19 of 19 files at r3. demos/util.ts, line 21 at r3 (raw file):
if you're using ENV, you can just use the WEBGL_VERSION directly demos/benchmarks/batchnormalization3d_benchmark.ts, line 32 at r3 (raw file):
safeMode demos/benchmarks/batchnormalization3d_benchmark.ts, line 52 at r3 (raw file):
safeMode demos/benchmarks/benchmark_util.ts, line 6 at r3 (raw file):
no need to warmup now that you upload immediately. demos/benchmarks/matmul_benchmarks.ts, line 31 at r3 (raw file):
safeMode demos/benchmarks/matmul_benchmarks.ts, line 46 at r3 (raw file):
safeMode demos/benchmarks/pool_benchmarks.ts, line 61 at r3 (raw file):
safeMode demos/benchmarks/pool_benchmarks.ts, line 87 at r3 (raw file):
safeMode demos/benchmarks/reduction_ops_benchmark.ts, line 45 at r3 (raw file):
safeMode demos/benchmarks/reduction_ops_benchmark.ts, line 62 at r3 (raw file):
safeMode demos/benchmarks/unary_ops_benchmark.ts, line 65 at r3 (raw file):
safeMode demos/benchmarks/unary_ops_benchmark.ts, line 82 at r3 (raw file):
safeMode demos/complementary-color-prediction/complementary-color-prediction.ts, line 160 at r3 (raw file):
safeMode demos/fast-style-transfer/fast-style-transfer.ts, line 263 at r3 (raw file):
why revert to this approach? The other one is much faster for live style transfer which we want to get out the door. demos/imagenet/imagenet.ts, line 107 at r3 (raw file):
safeMode demos/latent-space-explorer/App.vue, line 152 at r3 (raw file):
indentation is off here - use await instead of .then and you wont have to fix indentation demos/ml_beginners/ml_beginners.ts, line 68 at r3 (raw file):
remove result.shape here for consistency demos/ml_beginners/ml_beginners.ts, line 69 at r3 (raw file):
use dataSync demos/nn-art/cppn.ts, line 77 at r3 (raw file):
safeMode demos/teachable_gaming/teachable_gaming.ts, line 210 at r3 (raw file):
safeMode models/squeezenet/squeezenet.ts, line 190 at r3 (raw file):
fine to keep this on CPU but maybe move it to a models/util.ts since we use this everywhere Comments from Reviewable |
Thanks for the awesome fast review! Reviewed 20 of 27 files at r1, 2 of 19 files at r2. demos/util.ts, line 21 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/batchnormalization3d_benchmark.ts, line 32 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/batchnormalization3d_benchmark.ts, line 52 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/benchmark_util.ts, line 6 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
still need warmup for the shader programs to compile demos/benchmarks/matmul_benchmarks.ts, line 31 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/matmul_benchmarks.ts, line 46 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/pool_benchmarks.ts, line 61 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/pool_benchmarks.ts, line 87 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/reduction_ops_benchmark.ts, line 45 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/reduction_ops_benchmark.ts, line 62 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/unary_ops_benchmark.ts, line 65 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/benchmarks/unary_ops_benchmark.ts, line 82 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/complementary-color-prediction/complementary-color-prediction.ts, line 160 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/fast-style-transfer/fast-style-transfer.ts, line 263 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
It was the very first demo I tried to fix, thus reverting to canvas pixel copying. After exposing those methods, I left this demo since I felt we should convert when we actually do live. By then, maybe we find a better way to attach to the canvas demos/imagenet/imagenet.ts, line 107 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/latent-space-explorer/App.vue, line 152 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Fixed indentation. Can't use await here since it's not TypeScript, it's es6 in a .vue file and the build setup relies on typescript to compile away async/await. demos/ml_beginners/ml_beginners.ts, line 68 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/ml_beginners/ml_beginners.ts, line 69 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/nn-art/cppn.ts, line 77 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. demos/teachable_gaming/teachable_gaming.ts, line 210 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. models/squeezenet/squeezenet.ts, line 190 at r3 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. Comments from Reviewable |
const oldMath = ENV.math; | ||
const safeMode = false; | ||
const math = new NDArrayMath('cpu', safeMode); | ||
ENV.setMath(math); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there. I got a bit confused when I saw this change.
Why are we using for the following computations the CPU, but set the math context in the end of this class method to the old math reference (GPU?) again? Furthermore, the old math reference is a new math object and not this.math
from the class. In addition, the NDArrayMath is used again even though it should be deprecated?
Looking at it without being into it, it seems like a temporary workaround?
0.3.15
.0.3.15
. In addition, make sure that models withpeerDependency
don't include the peer in their bundle.After this PR is submitted, I will increase the version number of each model (and make sure consumers of that model use the new version) and publish an npm package for each model.
This change is