GithubHelp home page GithubHelp logo

qjia7 / tfjs-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tensorflow/tfjs-core

2.0 2.0 1.0 64.11 MB

WebGL-accelerated ML // linear algebra // automatic differentiation for JavaScript.

Home Page: https://js.tensorflow.org

License: Apache License 2.0

TypeScript 99.02% HTML 0.41% JavaScript 0.32% Shell 0.25%

tfjs-core's People

Contributors

adarob avatar aman-tiwari avatar annxingyuan avatar astojilj avatar bileschi avatar caisq avatar cghawthorne avatar chalker avatar chaosmail avatar danielruf avatar davidsoergel avatar dsanders11 avatar dsmilkov avatar easadler avatar jaassoon avatar jameswex avatar jgartman avatar justadudewhohacks avatar kiaragrouwstra avatar lewuathe avatar manrajgrover avatar mpushkarna avatar nbardy avatar nkreeger avatar pyu10055 avatar reiinakano avatar ry avatar shancarter avatar tafsiri avatar zboldyga avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

haoyunfeix

tfjs-core's Issues

MatMul case fails with MatMulPackedProgramCS

Add code below into mobilenet/index.js to test.

let x = tf.tensor2d([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],[4,6]);
let k = tf.tensor2d([1,0,0,1,1,0,1,0,0,1,0,1],[6,2]);
x.matMul(k).print(1);

An incorrect result will occur.

Tensor
  dtype: float32
  rank: 2
  shape: [4,2]
  values:
    [[32, 13],
     [50, 31],
     [20, 49],
     [38, 67]]

render pipeline + cs pipeline makes result incorrect

TEST ENV:
Windows10, Chrome Canary(Version 77.0.3819.0), D3D11 backend.

CASE:

const inputShape = [1,3,3,1]; /*Ni,Hi,Wi,Ci*/
const filterShape = [2,2,1,1]; /*Hk,Wk,Ci,Co*/
const stride = 1;
const pad = 'valid';

const x = tf.tensor4d([1,2,3,4,5,6,7,8,9], inputShape);
const w = tf.tensor4d([1,1,1,1], filterShape);

const result = tf.conv2d(x, w, stride, pad);
result.print(1);

this case will use 3 ops:

if changing im2col or packTensor to render pipeline, result will be wrong.

wrong result:

Tensor
  dtype: float32
  rank: 4
  shape: [1,2,2,1]
  values:
    [[[[0],
       [0]],

      [[0],
       [0]]]]

tfjs-examples/mnist could not run correctly on compute-context

tfjs-examples/mnist could not run correctly on compute-context. It is related with that some operators could not work normally on compute-context.
These operators are as bleow,
batchMatMul, reduce, realDivide, add, subtract, exp, relu, conv2d, unpackTensor

depthwiseConv2d shader generate error

Errors:
Uncaught (in promise) TypeError: Cannot read property '0' of null
at getSampler2DCS (shader_compiler.ts:1577)
at getSamplerFromInInfoCS (shader_compiler.ts:172)
at getSampler4DCS (shader_compiler.ts:2006)
at getSamplerFromInInfoCS (shader_compiler.ts:176)
at getInputSamplingSnippetCS (shader_compiler.ts:227)
at shader_compiler.ts:107
at Array.map ()
at makeCSShader (shader_compiler.ts:106)
at compileCSProgram (gpgpu_math.ts:135)
at backend_webgl.ts:2435

Sample code:
async function depthwiseConv2dTestSingleDepth_() {
const fSize = 2;
const pad = 'valid';
const stride = 1;
const chMul = 1;
const inDepth = 1;
ENV.set('WEBGL_PACK', false);
console.log(ENV.get('WEBGL_PACK'));
const x = tf.tensor4d(
[
0, 1, 2, 5, 0, 5,
0, 1, 5
],
[1, 3, 3, inDepth]);
const w = tf.tensor4d(
[1.0, 2.0, 2.0, 2.0],
[fSize, fSize, inDepth, chMul],
);

const result = tf.depthwiseConv2d(x, w, stride, pad);
result.print();
}

depthwiseConv2dTestSingleDepth_();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.