├── .firebaserc ├── .babelrc ├── scaffolds ├── draft.md ├── page.md └── post.md ├── source ├── api │ ├── 0.10.0 │ │ └── index.md │ ├── 0.11.1 │ │ └── index.md │ ├── 0.11.2 │ │ └── index.md │ ├── 0.11.6 │ │ └── index.md │ ├── 0.11.7 │ │ └── index.md │ ├── 0.12.0 │ │ └── index.md │ ├── 0.12.5 │ │ └── index.md │ ├── 0.13.0 │ │ └── index.md │ ├── 0.13.3 │ │ └── index.md │ ├── 0.14.1 │ │ └── index.md │ ├── 0.6.0 │ │ └── index.md │ ├── 0.6.1 │ │ └── index.md │ ├── 0.7.0 │ │ └── index.md │ ├── 0.8.0 │ │ └── index.md │ ├── 0.9.0 │ │ └── index.md │ └── latest │ │ └── index.md ├── images │ ├── ml5.png │ ├── favicon.png │ ├── mnist_3.png │ ├── mnist_4.png │ ├── mnist_8.png │ ├── tfjs-vis.png │ ├── TF_JS_lockup.png │ ├── coding-train.png │ ├── tfjs-models.png │ ├── TF_JS_twitter.png │ ├── fit_curve_data.png │ ├── mnist_learned.png │ ├── tfjs-examples.png │ ├── baseball_preview.png │ ├── fit_curve_learned.png │ ├── fit_curve_random.png │ ├── pacman-controller.png │ ├── posenet_preview.jpg │ ├── EmojiScavengerHunt.png │ ├── fit_curve_function.png │ ├── performance_rnn_preview.jpg │ └── teachablemachine_preview.jpg ├── index.md ├── _data │ └── api │ │ ├── 0.10.0 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.6.1 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.7.0 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.8.0 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.9.0 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.11.1 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.11.2 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.11.6 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.11.7 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.12.0 │ │ ├── docs_manifest.json │ │ └── skeleton.json │ │ ├── 0.12.5 │ │ ├── docs_manifest.json │ │ ├── tfjs-converter.json │ │ └── skeleton.json │ │ ├── 0.13.0 │ │ ├── docs_manifest.json │ │ ├── tfjs-converter.json │ │ └── skeleton.json │ │ ├── 0.13.3 │ │ ├── docs_manifest.json │ │ ├── tfjs-converter.json │ │ └── skeleton.json │ │ ├── 0.14.1 │ │ ├── docs_manifest.json │ │ └── tfjs-converter.json │ │ └── api_manifest.json ├── setup │ └── index.md ├── debug │ └── index.html ├── tutorials │ ├── index.md │ ├── import-keras.md │ ├── custom-webgl-op.md │ ├── import-saved-model.md │ └── how-to-get-started.md ├── faq │ └── index.md └── demos │ └── index.md ├── themes └── dljs │ ├── _config.yml │ ├── layout │ ├── page.hbs │ ├── partials │ │ ├── apiHeading.hbs │ │ ├── apiSubhead.hbs │ │ ├── footer.hbs │ │ ├── apiClass.hbs │ │ ├── apiParamList.hbs │ │ ├── apiFunction.hbs │ │ ├── apiToc.hbs │ │ └── header.hbs │ ├── api.hbs │ ├── layout.hbs │ └── setup.hbs │ ├── source │ ├── js │ │ ├── layout.js │ │ ├── api.js │ │ └── codeSnippets.js │ └── css │ │ ├── vendor │ │ ├── codemirror-railscasts.css │ │ └── highlight-railscasts.css │ │ └── api.scss │ └── helper │ └── index.js ├── .gitignore ├── firebase.json ├── .gitmodules ├── tsconfig.json ├── .vscode ├── tasks.json └── settings.json ├── _config.yml ├── package.json └── README.md /.firebaserc: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015" 4 | ] 5 | } -------------------------------------------------------------------------------- /scaffolds/draft.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: {{ title }} 3 | tags: 4 | --- 5 | -------------------------------------------------------------------------------- /scaffolds/page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: {{ title }} 3 | date: {{ date }} 4 | --- 5 | -------------------------------------------------------------------------------- /scaffolds/post.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: {{ title }} 3 | date: {{ date }} 4 | tags: 5 | --- 6 | -------------------------------------------------------------------------------- /source/api/0.10.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.10.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.11.1/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.11.1 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.11.2/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.11.2 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.11.6/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.11.6 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.11.7/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.11.7 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.12.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.12.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.12.5/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.12.5 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.13.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.13.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.13.3/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.13.3 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.14.1/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.14.1 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.6.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.6.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.6.1/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.6.1 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.7.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.7.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.8.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.8.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/0.9.0/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.9.0 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/api/latest/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 0.14.1 3 | layout: api 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/images/ml5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/ml5.png -------------------------------------------------------------------------------- /themes/dljs/_config.yml: -------------------------------------------------------------------------------- 1 | # Do not delete. 2 | node_sass: 3 | includePaths: ['./node_modules/'] 4 | -------------------------------------------------------------------------------- /source/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/favicon.png -------------------------------------------------------------------------------- /source/images/mnist_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/mnist_3.png -------------------------------------------------------------------------------- /source/images/mnist_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/mnist_4.png -------------------------------------------------------------------------------- /source/images/mnist_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/mnist_8.png -------------------------------------------------------------------------------- /source/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TensorFlow.JS 3 | date: 2018-02-22 14:50:37 4 | layout: index 5 | --- 6 | -------------------------------------------------------------------------------- /source/images/tfjs-vis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/tfjs-vis.png -------------------------------------------------------------------------------- /source/images/TF_JS_lockup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/TF_JS_lockup.png -------------------------------------------------------------------------------- /source/images/coding-train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/coding-train.png -------------------------------------------------------------------------------- /source/images/tfjs-models.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/tfjs-models.png -------------------------------------------------------------------------------- /source/images/TF_JS_twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/TF_JS_twitter.png -------------------------------------------------------------------------------- /source/images/fit_curve_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/fit_curve_data.png -------------------------------------------------------------------------------- /source/images/mnist_learned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/mnist_learned.png -------------------------------------------------------------------------------- /source/images/tfjs-examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/tfjs-examples.png -------------------------------------------------------------------------------- /source/images/baseball_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/baseball_preview.png -------------------------------------------------------------------------------- /source/images/fit_curve_learned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/fit_curve_learned.png -------------------------------------------------------------------------------- /source/images/fit_curve_random.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/fit_curve_random.png -------------------------------------------------------------------------------- /source/images/pacman-controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/pacman-controller.png -------------------------------------------------------------------------------- /source/images/posenet_preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/posenet_preview.jpg -------------------------------------------------------------------------------- /source/images/EmojiScavengerHunt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/EmojiScavengerHunt.png -------------------------------------------------------------------------------- /source/images/fit_curve_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/fit_curve_function.png -------------------------------------------------------------------------------- /source/_data/api/0.10.0/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.10.0", 3 | "coreVersion": "v0.8.1", 4 | "layersVersion": "v0.5.0" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.6.1/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.6.1", 3 | "coreVersion": "v0.6.0", 4 | "layersVersion": "v0.1.2" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.7.0/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.7.0", 3 | "coreVersion": "v0.6.0", 4 | "layersVersion": "v0.2.0" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.8.0/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.8.0", 3 | "coreVersion": "v0.6.1", 4 | "layersVersion": "v0.3.0" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.9.0/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.9.0", 3 | "coreVersion": "v0.7.1", 4 | "layersVersion": "v0.4.0" 5 | } -------------------------------------------------------------------------------- /source/images/performance_rnn_preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/performance_rnn_preview.jpg -------------------------------------------------------------------------------- /source/images/teachablemachine_preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0101011/tfjs-website/master/source/images/teachablemachine_preview.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | public 3 | .cache 4 | db.json 5 | libs 6 | .DS_Store 7 | source/_data/api/local 8 | source/api/local 9 | 10 | -------------------------------------------------------------------------------- /source/_data/api/0.11.1/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.11.1", 3 | "coreVersion": "v0.11.0", 4 | "layersVersion": "v0.6.1" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.11.2/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.11.2", 3 | "coreVersion": "v0.11.1", 4 | "layersVersion": "v0.6.2" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.11.6/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.11.6", 3 | "coreVersion": "v0.11.6", 4 | "layersVersion": "v0.6.6" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.11.7/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.11.7", 3 | "coreVersion": "v0.11.9", 4 | "layersVersion": "v0.6.7" 5 | } -------------------------------------------------------------------------------- /source/_data/api/0.12.0/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.12.0", 3 | "coreVersion": "v0.12.0", 4 | "layersVersion": "v0.7.0" 5 | } -------------------------------------------------------------------------------- /source/setup/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: setup 3 | align: center 4 | date: 2018-12-10 10:38:08 5 | bannerText: Setup TensorFlow.js 6 | layout: setup 7 | --- 8 | 9 | -------------------------------------------------------------------------------- /source/_data/api/0.12.5/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.12.5", 3 | "coreVersion": "v0.12.11", 4 | "layersVersion": "v0.7.4", 5 | "converterVersion": "v0.5.7" 6 | } -------------------------------------------------------------------------------- /source/_data/api/0.13.0/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.13.0", 3 | "coreVersion": "v0.13.0", 4 | "layersVersion": "v0.8.0", 5 | "converterVersion": "v0.6.0" 6 | } -------------------------------------------------------------------------------- /source/_data/api/0.13.3/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.13.3", 3 | "coreVersion": "v0.13.8", 4 | "layersVersion": "v0.8.3", 5 | "converterVersion": "v0.6.5" 6 | } -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "public", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /source/_data/api/0.14.1/docs_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "tfjsVersion": "0.14.1", 3 | "coreVersion": "v0.14.2", 4 | "layersVersion": "v0.9.1", 5 | "converterVersion": "v0.7.1", 6 | "dataVersion": "v0.1.4" 7 | } -------------------------------------------------------------------------------- /themes/dljs/layout/page.hbs: -------------------------------------------------------------------------------- 1 | {{#if page.bannerText}} 2 |
3 |

{{page.bannerText}}

4 |
5 | {{/if}} 6 | 7 |
8 | {{{page.content}}} 9 |
10 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/apiHeading.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{name}} 4 |
5 |
6 | {{{description}}} 7 |
8 |
9 | -------------------------------------------------------------------------------- /source/_data/api/api_manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "versions": [ 3 | "0.14.1", 4 | "0.13.3", 5 | "0.13.0", 6 | "0.12.5", 7 | "0.12.0", 8 | "0.11.7", 9 | "0.11.6", 10 | "0.11.2", 11 | "0.11.1", 12 | "0.10.0", 13 | "0.9.0", 14 | "0.8.0", 15 | "0.7.0", 16 | "0.6.1" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/apiSubhead.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | {{headingName}} / {{name}} 5 | 6 |
7 |
8 | {{{description}}} 9 |
10 |
11 | -------------------------------------------------------------------------------- /themes/dljs/source/js/layout.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function(e) { 2 | function initNavDraw() { 3 | var drawer = new mdc.drawer.MDCTemporaryDrawer( 4 | document.querySelector('.mdc-drawer--temporary')); 5 | 6 | var drawerButton = document.getElementById('nav-menu-button'); 7 | 8 | drawerButton.addEventListener('click', function() { 9 | drawer.open = true; 10 | }); 11 | } 12 | 13 | initNavDraw(); 14 | }); 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libs/tfjs-core"] 2 | path = libs/tfjs-core 3 | url = git@github.com:PAIR-code/deeplearnjs.git 4 | [submodule "libs/tfjs-layers"] 5 | path = libs/tfjs-layers 6 | url = git@github.com:tensorflow/tfjs-layers.git 7 | [submodule "libs/tfjs-converter"] 8 | path = libs/tfjs-converter 9 | url = git@github.com:tensorflow/tfjs-converter 10 | [submodule "libs/tfjs-data"] 11 | path = libs/tfjs-data 12 | url = https://github.com/tensorflow/tfjs-data.git 13 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitAny": false, 4 | "sourceMap": true, 5 | "removeComments": true, 6 | "preserveConstEnums": true, 7 | "declaration": true, 8 | "lib": [ 9 | "es2015" 10 | ], 11 | "noUnusedLocals": false, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "alwaysStrict": true, 15 | "noUnusedParameters": false, 16 | "pretty": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "allowUnreachableCode": false, 19 | "experimentalDecorators": true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "command": "yarn", 6 | "label": "lint", 7 | "type": "shell", 8 | "args": [ 9 | "lint" 10 | ], 11 | "problemMatcher": { 12 | "base": "$tslint5", 13 | "owner": "tslint-type-checked", 14 | "fileLocation": "absolute" 15 | } 16 | }, 17 | { 18 | "command": "yarn", 19 | "label": "build", 20 | "type": "shell", 21 | "args": ["build", "--pretty", "false"], 22 | "problemMatcher": [ 23 | "$tsc" 24 | ] 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/footer.hbs: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/apiClass.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | {{~displayName~}} 5 | 6 | 7 | {{#if inheritsFrom}} 8 | extends {{{markdownInner inheritsFrom}}} 9 | {{/if}} 10 | 11 | class 12 | 13 | Source 14 | 15 |
16 | 17 |
{{{markdown documentation}}}
18 | 19 | {{!-- Method List --}} 20 |
21 | {{#methods}} 22 | {{~> apiFunction this isMethod=true~}} 23 | {{/methods}} 24 |
25 |
26 | -------------------------------------------------------------------------------- /themes/dljs/layout/api.hbs: -------------------------------------------------------------------------------- 1 |
2 | {{!-- Left Page TOC --}} 3 |
4 | {{> apiToc }} 5 |
6 | {{!-- Main Content Area --}} 7 | {{#with (getApi page.site.data page.title)}} 8 |
9 | {{#headings}} 10 |
11 | {{> apiHeading name=name desc=description}} 12 | {{#subheadings}} 13 | {{> apiSubhead name=name headingName=../name desc=description}} 14 | {{#symbols}} 15 | {{#if isClass}} 16 | {{~> apiClass symbol=this~}} 17 | {{else}} 18 | {{~> apiFunction symbol=this ~}} 19 | {{/if}} 20 | {{/symbols}} 21 | {{/subheadings}} 22 |
23 | {{/headings}} 24 |
25 | {{/with}} 26 | {{!-- End --}} 27 |
28 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/apiParamList.hbs: -------------------------------------------------------------------------------- 1 | {{!-- Inline Helper --}} 2 | {{#*inline "param"}} 3 | {{name}} 4 | ({{{markdownInner type}}}) 5 | {{{markdownInner documentation}}} 6 | {{#optional}} 7 | 8 | Optional 9 | 10 | {{/optional}} 11 | {{/inline}} 12 | 13 | {{!-- Main template --}} 14 | {{#if parameters.length}} 15 |
16 |
Parameters:
17 | 31 |
32 | {{/if}} 33 | 34 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "search.exclude": { 4 | "**/node_modules": true, 5 | "**/bower_components": true, 6 | "coverage/": true, 7 | "dist/": true, 8 | "**/bundle.js": true, 9 | "**/yarn.lock": true 10 | }, 11 | "tslint.enable": true, 12 | "tslint.run": "onType", 13 | "tslint.configFile": "tslint.json", 14 | "files.trimTrailingWhitespace": true, 15 | "editor.tabSize": 2, 16 | "editor.insertSpaces": true, 17 | "[typescript]": { 18 | "editor.formatOnSave": true 19 | }, 20 | "[javascript]": { 21 | "editor.formatOnSave": true 22 | }, 23 | "clang-format.style": "Google", 24 | "files.insertFinalNewline": true, 25 | "editor.detectIndentation": false, 26 | "editor.wrappingIndent": "none", 27 | "typescript.tsdk": "node_modules/typescript/lib", 28 | "clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format", 29 | "html.format.unformatted": "template", 30 | } 31 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/apiFunction.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | {{!-- TODO remove conditional once https://github.com/tensorflow/tfjs-website/issues/33 is fixed --}} 5 | {{~#if displayName ~}} 6 | {{~{displayName}~}} 7 | {{~else~}} 8 | {{~{symbolName}~}} 9 | {{~/if~}} 10 | 11 | 12 | {{~{paramStr}~}} 13 | 14 | {{#if isMethod}} 15 | method 16 | {{else}} 17 | function 18 | {{/if}} 19 | 20 | Source 21 | 22 |
23 | 24 |
{{{markdown documentation}}}
25 | 26 | {{!-- Param List --}} 27 | {{> apiParamList parameters=parameters}} 28 | 29 | {{!-- Returns --}} 30 |
31 | Returns: 32 | {{{markdownInner returnType}}} 33 |
34 |
35 | 36 | -------------------------------------------------------------------------------- /source/debug/index.html: -------------------------------------------------------------------------------- 1 |

TensorFlow.js Debug info

2 | 3 |
4 |
5 | 6 | 18 | 19 | 41 | -------------------------------------------------------------------------------- /themes/dljs/source/css/vendor/codemirror-railscasts.css: -------------------------------------------------------------------------------- 1 | .cm-s-railscasts { 2 | font-size: 1em; 3 | line-height: 1.5em; 4 | font-family: inconsolata, monospace; 5 | letter-spacing: 0.3px; 6 | word-spacing: 1px; 7 | background: #232323; 8 | color: #E6E1DC; 9 | } 10 | .cm-s-railscasts .CodeMirror-lines { 11 | padding: 8px 0; 12 | } 13 | .cm-s-railscasts .CodeMirror-gutters { 14 | box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5); 15 | -webkit-box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5); 16 | background-color: #232323; 17 | padding-right: 10px; 18 | z-index: 3; 19 | border: none; 20 | } 21 | .cm-s-railscasts div.CodeMirror-cursor { 22 | border-left: 3px solid #E6E1DC; 23 | } 24 | .cm-s-railscasts .CodeMirror-activeline-background { 25 | background: #333435; 26 | } 27 | .cm-s-railscasts .CodeMirror-selected { 28 | background: #5A647EE0; 29 | } 30 | .cm-s-railscasts .cm-comment { 31 | font-style: italic; 32 | color: #BC9458; 33 | } 34 | .cm-s-railscasts .cm-number { 35 | color: #a5c261 36 | } 37 | .cm-s-railscasts .cm-atom { 38 | color: #DA4939; 39 | } 40 | .cm-s-railscasts .cm-string { 41 | color: #a5c261 42 | } 43 | .cm-s-railscasts .cm-property { 44 | color: null; 45 | } 46 | .cm-s-railscasts .cm-keyword { 47 | color: #c26230; 48 | } 49 | .cm-s-railscasts .cm-operator { 50 | color: null; 51 | } 52 | .cm-s-railscasts .CodeMirror-linenumber { 53 | color: italic; 54 | } 55 | 56 | /* Custom styles specific to js.tensorflow.org */ 57 | 58 | .CodeMirror-lines { 59 | padding-left: 16px !important; 60 | } 61 | 62 | .CodeMirror { 63 | font-family: "Roboto Mono", Roboto; 64 | font-size: 13px; 65 | border-radius: 5px; 66 | height: auto; 67 | 68 | } 69 | -------------------------------------------------------------------------------- /themes/dljs/source/css/vendor/highlight-railscasts.css: -------------------------------------------------------------------------------- 1 | .hljs { 2 | display: block; 3 | overflow-x: auto; 4 | padding: 0.5em; 5 | background: #232323; 6 | color: #e6e1dc 7 | } 8 | 9 | .hljs-comment, 10 | .hljs-quote { 11 | color: #bc9458; 12 | font-style: italic 13 | } 14 | 15 | .hljs-keyword, 16 | .hljs-selector-tag { 17 | color: #c26230 18 | } 19 | 20 | .hljs-string, 21 | .hljs-number, 22 | .hljs-regexp, 23 | .hljs-variable, 24 | .hljs-template-variable { 25 | color: #a5c261 26 | } 27 | 28 | .hljs-subst { 29 | color: #519f50 30 | } 31 | 32 | .hljs-tag, 33 | .hljs-name { 34 | color: #e8bf6a 35 | } 36 | 37 | .hljs-type { 38 | color: #da4939 39 | } 40 | 41 | .hljs-symbol, 42 | .hljs-bullet, 43 | .hljs-built_in, 44 | .hljs-builtin-name, 45 | .hljs-attr, 46 | .hljs-link { 47 | color: #6d9cbe 48 | } 49 | 50 | .hljs-params { 51 | color: #d0d0ff 52 | } 53 | 54 | .hljs-attribute { 55 | color: #cda869 56 | } 57 | 58 | .hljs-meta { 59 | color: #9b859d 60 | } 61 | 62 | .hljs-title, 63 | .hljs-section { 64 | color: #ffc66d 65 | } 66 | 67 | .hljs-addition { 68 | background-color: #144212; 69 | color: #e6e1dc; 70 | display: inline-block; 71 | width: 100% 72 | } 73 | 74 | .hljs-deletion { 75 | background-color: #600; 76 | color: #e6e1dc; 77 | display: inline-block; 78 | width: 100% 79 | } 80 | 81 | .hljs-selector-class { 82 | color: #9b703f 83 | } 84 | 85 | .hljs-selector-id { 86 | color: #8b98ab 87 | } 88 | 89 | .hljs-emphasis { 90 | font-style: italic 91 | } 92 | 93 | .hljs-strong { 94 | font-weight: bold 95 | } 96 | 97 | .hljs-link { 98 | text-decoration: underline 99 | } 100 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Hexo Configuration 2 | ## Docs: https://hexo.io/docs/configuration.html 3 | ## Source: https://github.com/hexojs/hexo/ 4 | 5 | # Site 6 | title: TensorFlow.js 7 | subtitle: 8 | description: 9 | author: 10 | language: 11 | timezone: 12 | 13 | # URL 14 | ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' 15 | url: js.tensorflow.org 16 | root: / 17 | permalink: :year/:month/:day/:title/ 18 | permalink_defaults: 19 | 20 | # Directory 21 | source_dir: source 22 | public_dir: public 23 | i18n_dir: :lang 24 | skip_render: 25 | 26 | # Writing 27 | new_post_name: :title.md # File name of new posts 28 | default_layout: post 29 | titlecase: false # Transform title into titlecase 30 | external_link: true # Open external links in new tab 31 | filename_case: 0 32 | render_drafts: false 33 | post_asset_folder: false 34 | relative_link: true 35 | future: true 36 | 37 | highlight: 38 | enable: true 39 | line_number: false 40 | auto_detect: false 41 | hljs: true 42 | tab: true 43 | 44 | # Category & Tag 45 | default_category: uncategorized 46 | category_map: 47 | tag_map: 48 | 49 | # Date / Time format 50 | ## Hexo uses Moment.js to parse and display date 51 | ## You can customize the date format as defined in 52 | ## http://momentjs.com/docs/#/displaying/format/ 53 | date_format: YYYY-MM-DD 54 | time_format: HH:mm:ss 55 | 56 | # Pagination 57 | ## Set per_page to 0 to disable pagination 58 | per_page: 10 59 | pagination_dir: page 60 | 61 | # Extensions 62 | ## Plugins: https://hexo.io/plugins/ 63 | ## Themes: https://hexo.io/themes/ 64 | theme: dljs 65 | 66 | # Deployment 67 | ## Docs: https://hexo.io/docs/deployment.html 68 | deploy: 69 | type: 70 | 71 | browsersync: 72 | logLevel: "warn" 73 | ghostMode: 74 | scroll: true 75 | notify: false 76 | 77 | 78 | markdown: 79 | render: 80 | html: true 81 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/apiToc.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
API Version
6 |
7 |
8 |
9 |
10 |
    11 | {{#each (docVersions)}} 12 |
  • {{this}}
  • {{/each}}
14 | {{#with (getApi page.site.data page.title)}} {{#headings}}
15 |
16 | {{name}} 17 |
18 | 19 | {{#subheadings}} 20 |
21 |
22 | {{name}} 23 |
24 | 25 | {{#symbols}} 26 |
27 | {{displayName}} 28 | {{#if isClass}} 29 |
30 | {{#methods}} 31 |
32 | .{{symbolName}} 33 |
34 | {{/methods}} 35 |
36 | {{/if}} 37 |
38 | {{/symbols}} 39 |
40 | {{/subheadings}} 41 | 42 |
43 | {{/headings}} 44 | {{/with}} 45 |
46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tensorflow-js-website", 3 | "version": "0.0.1", 4 | "private": true, 5 | "hexo": { 6 | "version": "3.6.0" 7 | }, 8 | "engines": { 9 | "node": ">=8.9.0" 10 | }, 11 | "scripts": { 12 | "prep": "git submodule init && git submodule update && git submodule foreach git pull origin master && yarn", 13 | "serve": "export NODE_OPTIONS=--max-old-space-size=8192 hexo clean && hexo server", 14 | "build": "export NODE_OPTIONS=--max-old-space-size=4096 hexo clean && hexo generate", 15 | "post-build": "babel public/js/layout.js -o public/js/layout.js && babel public/js/api.js -o public/js/api.js", 16 | "build-api": "hexo clean && node build-scripts/build-api.js --local", 17 | "build-and-serve": "yarn build-api && yarn serve", 18 | "build-prod": "export NODE_OPTIONS=--max-old-space-size=4096 yarn prep && hexo clean && node build-scripts/build-api.js && yarn build && yarn post-build" 19 | }, 20 | "dependencies": { 21 | "@tensorflow/tfjs": "0.14.1", 22 | "babel-cli": "~6.26.0", 23 | "babel-preset-es2015": "~6.24.1", 24 | "commander": "~2.14.1", 25 | "hexo": "~3.6.0", 26 | "hexo-browsersync": "^0.3.0", 27 | "hexo-generator-archive": "~0.1.4", 28 | "hexo-generator-category": "~0.1.3", 29 | "hexo-generator-tag": "~0.2.0", 30 | "hexo-renderer-ejs": "~0.3.0", 31 | "hexo-renderer-handlebars": "~2.0.2", 32 | "hexo-renderer-markdown-it": "^3.4.1", 33 | "hexo-renderer-sass": "~0.3.2", 34 | "hexo-renderer-stylus": "~0.3.1", 35 | "hexo-server": "~0.2.0", 36 | "highlight.js": "^9.12.0", 37 | "markdown-it": "^8.4.1", 38 | "material-components-web": "^0.32.0", 39 | "mkdirp": "~0.5.1", 40 | "semver-compare": "^1.0.0", 41 | "shelljs": "~0.8.1", 42 | "ts-node": "~4.1.0", 43 | "typescript": "~2.7.2" 44 | }, 45 | "devDependencies": { 46 | "@types/node": "~9.4.6", 47 | "clang-format": "~1.2.4" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /themes/dljs/source/js/api.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function(e) { 2 | // Set up version selector 3 | var select = new mdc.select.MDCSelect(document.querySelector('.mdc-select')); 4 | select.listen('MDCSelect:change', () => { 5 | var link = select.selectedOptions[0].getAttribute('data-link'); 6 | window.location.href = link; 7 | }); 8 | 9 | var isInViewport = function(elem) { 10 | var bounding = elem.getBoundingClientRect(); 11 | return ( 12 | bounding.top >= 0 && bounding.left >= 0 && 13 | bounding.bottom <= 14 | (window.innerHeight || document.documentElement.clientHeight) && 15 | bounding.right <= 16 | (window.innerWidth || document.documentElement.clientWidth)); 17 | }; 18 | // Find the symbol closest to the top of the page in the reference 19 | // section and highlight it in the TOC section. 20 | var refSymbols = document.querySelectorAll('.symbol-link'); 21 | var tocArea = document.querySelector('.toc'); 22 | var lastHighlightedTocElement; 23 | function updateTocView() { 24 | var top = window.scrollY; 25 | var found; 26 | var tocFound; 27 | var symbol; 28 | var sTop; 29 | 30 | for (var i = 0; i < refSymbols.length; i++) { 31 | symbol = refSymbols[i]; 32 | sTop = symbol.offsetTop; 33 | if (sTop >= top) { 34 | found = symbol; 35 | break; 36 | } 37 | } 38 | 39 | if (found) { 40 | tocFound = 41 | tocArea.querySelector(`[href="#${found.getAttribute('name')}"]`) 42 | 43 | if (tocFound) { 44 | if (lastHighlightedTocElement) { 45 | lastHighlightedTocElement.classList.remove('highlighted'); 46 | } 47 | tocFound.classList.add('highlighted'); 48 | if (!isInViewport(tocFound)) { 49 | tocFound.scrollIntoView(false); 50 | } 51 | lastHighlightedTocElement = tocFound; 52 | } 53 | } 54 | } 55 | 56 | window.addEventListener('scroll', updateTocView); 57 | window.addEventListener('resize', updateTocView); 58 | 59 | // Initialize runnable code snippets 60 | initCodeBlocks('.language-js'); 61 | }); 62 | -------------------------------------------------------------------------------- /themes/dljs/helper/index.js: -------------------------------------------------------------------------------- 1 | const MarkdownIt = require('markdown-it'); 2 | 3 | const hljs = require('highlight.js'); 4 | 5 | const md = new MarkdownIt({ 6 | highlight(str, lang) { 7 | if (lang === 'js' && hljs.getLanguage(lang)) { 8 | const highlighted = hljs.highlight(lang, str).value; 9 | return '
' + highlighted +
10 |           '
\n'; 11 | } 12 | 13 | return ''; // use external default escaping 14 | } 15 | }); 16 | 17 | module.exports = function(hexo) { 18 | return { 19 | toJson: function(obj) { 20 | return JSON.stringify(obj); 21 | }, 22 | 23 | isApiPage: function(path) { 24 | return path.match(/^api/); 25 | }, 26 | 27 | getApi: function(siteData, versionString) { 28 | return siteData[`api/${versionString}/docs`]; 29 | }, 30 | 31 | markdown: function(attr) { 32 | if (attr) { 33 | return md.render(attr); 34 | } 35 | }, 36 | 37 | markdownInner: function(attr) { 38 | if (attr) { 39 | const asMd = md.render(attr.trim()) 40 | .replace(/

/, '') 41 | .replace(/(<\/p>\s*)$/, ''); 42 | 43 | return asMd; 44 | } 45 | }, 46 | 47 | latestVersion: function() { 48 | return hexo.locals.cache.data['api/api_manifest'].versions[0]; 49 | }, 50 | 51 | docVersions: function() { 52 | return hexo.locals.cache.data['api/api_manifest'].versions; 53 | }, 54 | 55 | eq(a, b) { 56 | return a === b; 57 | }, 58 | 59 | concat: function(a, b) { 60 | return a + b; 61 | }, 62 | 63 | codepenHtml: function() { 64 | return JSON.stringify( 65 | `

Try Tensorflow JS right in your browser. Look at the console to see the output.

`); 66 | }, 67 | 68 | codepenJs: function() { 69 | return JSON.stringify(`// Define a model for linear regression. 70 | const model = tf.sequential(); 71 | model.add(tf.layers.dense({units: 1, inputShape: [1]})); 72 | 73 | // Prepare the model for training: Specify the loss and the optimizer. 74 | model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); 75 | 76 | // Generate some synthetic data for training. 77 | const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); 78 | const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); 79 | 80 | // Train the model using the data. 81 | model.fit(xs, ys).then(() => { 82 | // Use the model to do inference on a data point the model hasn't seen before: 83 | // Open the browser devtools to see the output 84 | model.predict(tf.tensor2d([5], [1, 1])).print(); 85 | }); 86 | `); 87 | } 88 | }; 89 | }; 90 | -------------------------------------------------------------------------------- /source/tutorials/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: tutorials 3 | date: 2018-03-02 11:45:36 4 | bannerText: Tutorials & Guides 5 | --- 6 | 7 | # Tutorials 8 | 9 | ## Getting Started 10 |

Core Concepts in TensorFlow.js

11 | 12 | Learn about core concepts in TensorFlow.js such as tensors, operations, models, layers and training. 13 | Also learn a few useful tips about memory management and writing "tidy" code. 14 | 15 |

TensorFlow.js Layers API for Keras Users

16 | 17 | This guide explains the similarities and differences between the Layers API 18 | of TensorFlow.js and [Keras](https://keras.io/). 19 | 20 |

How to get started with X: a guide for TensorFlow.js Users

21 | 22 | This guide provides a number of resources for getting started with the different domains involved in programming with TensorFlow.js. 23 | 24 | 25 | ## Training Models 26 | 27 |

Training First Steps: Fitting a Curve to Synthetic Data

28 | 29 | This tutorial demonstrates building a small toy model completely from scratch using TensorFlow.js operations. We will fit a curve to some synthetic data that we generate using a polynomial function. 30 | 31 |

Training on images — Recognizing Handwritten Digits with a Convolutional Neural Network

32 | 33 | This tutorial shows how to build a convolutional neural network to recognize 34 | handwritten digits in images (MNIST). We will use the TensorFlow.js layers API 35 | to construct, train, and evaluate the model. 36 | 37 |

Transfer learning - Train a neural network to predict from webcam data

38 | 39 | This tutorial explains how to train a neural network to make predictions from 40 | webcam data. We'll use those predictions to play [Pac-Man](https://en.wikipedia.org/wiki/Pac-Man)! 41 | 42 |

Transfer learning - Build an Audio Recognition Model

43 | 44 | In this tutorial you will build an audio recognition network and use it to control a slider in the browser by making sounds. 45 | 46 | 47 |

Saving and Loading tf.Model

48 | 49 | This tutorial explains how to save `tf.Model`s to various destinations such as the web browser's Local Storage and load them back. 50 | 51 | ## Working with Pre-trained Models 52 | 53 |

How to import a Keras Model into TensorFlow.js

54 | 55 | This tutorial explains how to convert and serve an existing Keras model to run in the browser. 56 | 57 |

How to import a TensorFlow SavedModel into TensorFlow.js

58 | 59 | This tutorial explains how to convert and serve an existing TensorFlow SavedModel to run in the browser. 60 | 61 | 62 | ## Advanced Topics 63 | 64 |

How to define a custom WebGL operation

65 | 66 | This tutorial explains how to create a custom WebGL operation that can be used alongside other Tensorflow.js operations. 67 | -------------------------------------------------------------------------------- /themes/dljs/layout/partials/header.hbs: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 | 7 | TensorFlow.js 8 | 9 | 10 |
11 | 20 |
21 | 37 |
38 |
39 |
40 | 41 | 75 | -------------------------------------------------------------------------------- /source/_data/api/0.12.5/tfjs-converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "headings": [ 4 | { 5 | "name": "Models", 6 | "description": "", 7 | "subheadings": [ 8 | { 9 | "name": "Classes", 10 | "symbols": [ 11 | { 12 | "docInfo": { 13 | "heading": "Models", 14 | "subheading": "Classes" 15 | }, 16 | "symbolName": "FrozenModel", 17 | "documentation": "A `FrozenModel` is a directed, acyclic graph of built from\nSavedModel GraphDef and allows inference exeuction.", 18 | "fileName": "#32", 19 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.5.7/src/executor/frozen_model.ts#L32-L245", 20 | "methods": [], 21 | "isClass": true, 22 | "inheritsFrom": "tfc.InferenceModel" 23 | } 24 | ] 25 | }, 26 | { 27 | "name": "Loading", 28 | "symbols": [ 29 | { 30 | "docInfo": { 31 | "heading": "Models", 32 | "subheading": "Loading" 33 | }, 34 | "symbolName": "loadFrozenModel", 35 | "paramStr": "(modelUrl, weightsManifestUrl, requestOption?)", 36 | "parameters": [ 37 | { 38 | "name": "modelUrl", 39 | "documentation": "url for the model file generated by scripts/convert.py\nscript.", 40 | "type": "string", 41 | "optional": false, 42 | "isConfigParam": false 43 | }, 44 | { 45 | "name": "weightsManifestUrl", 46 | "documentation": "", 47 | "type": "string", 48 | "optional": false, 49 | "isConfigParam": false 50 | }, 51 | { 52 | "name": "requestOption", 53 | "documentation": "options for Request, which allows to send credentials\nand custom headers.", 54 | "type": "RequestInit", 55 | "optional": true, 56 | "isConfigParam": false 57 | } 58 | ], 59 | "returnType": "Promise", 60 | "documentation": "Load the frozen model through url.\n\nExample of loading the MobileNetV2 model and making a prediction with a zero\ninput.\n\n```js\nconst GOOGLE_CLOUD_STORAGE_DIR =\n 'https://storage.googleapis.com/tfjs-models/savedmodel/';\nconst MODEL_FILE_URL = 'mobilenet_v2_1.0_224/tensorflowjs_model.pb';\nconst WEIGHT_MANIFEST_FILE_URL =\n 'mobilenet_v2_1.0_224/weights_manifest.json';\nconst model = await tf.loadFrozenModel(MODEL_URL, WEIGHTS_URL);\nconst zeros = tf.zeros([1, 224, 224, 3]);\nmodel.predict(zeros);\n```", 61 | "fileName": "#272", 62 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.5.7/src/executor/frozen_model.ts#L272-L278", 63 | "isFunction": true 64 | } 65 | ] 66 | } 67 | ] 68 | } 69 | ] 70 | }, 71 | "docLinkAliases": {} 72 | } -------------------------------------------------------------------------------- /source/_data/api/0.13.0/tfjs-converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "headings": [ 4 | { 5 | "name": "Models", 6 | "description": "", 7 | "subheadings": [ 8 | { 9 | "name": "Classes", 10 | "symbols": [ 11 | { 12 | "docInfo": { 13 | "heading": "Models", 14 | "subheading": "Classes" 15 | }, 16 | "symbolName": "FrozenModel", 17 | "documentation": "A `FrozenModel` is a directed, acyclic graph of built from\nSavedModel GraphDef and allows inference exeuction.", 18 | "fileName": "#32", 19 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.6.0/src/executor/frozen_model.ts#L32-L260", 20 | "methods": [], 21 | "isClass": true, 22 | "inheritsFrom": "tfc.InferenceModel" 23 | } 24 | ] 25 | }, 26 | { 27 | "name": "Loading", 28 | "symbols": [ 29 | { 30 | "docInfo": { 31 | "heading": "Models", 32 | "subheading": "Loading" 33 | }, 34 | "symbolName": "loadFrozenModel", 35 | "paramStr": "(modelUrl, weightsManifestUrl, requestOption?)", 36 | "parameters": [ 37 | { 38 | "name": "modelUrl", 39 | "documentation": "url for the model file generated by scripts/convert.py\nscript.", 40 | "type": "string", 41 | "optional": false, 42 | "isConfigParam": false 43 | }, 44 | { 45 | "name": "weightsManifestUrl", 46 | "documentation": "", 47 | "type": "string", 48 | "optional": false, 49 | "isConfigParam": false 50 | }, 51 | { 52 | "name": "requestOption", 53 | "documentation": "options for Request, which allows to send credentials\nand custom headers.", 54 | "type": "RequestInit", 55 | "optional": true, 56 | "isConfigParam": false 57 | } 58 | ], 59 | "returnType": "Promise", 60 | "documentation": "Load the frozen model through url.\n\nExample of loading the MobileNetV2 model and making a prediction with a zero\ninput.\n\n```js\nconst GOOGLE_CLOUD_STORAGE_DIR =\n 'https://storage.googleapis.com/tfjs-models/savedmodel/';\nconst MODEL_URL = 'mobilenet_v2_1.0_224/tensorflowjs_model.pb';\nconst WEIGHTS_URL =\n 'mobilenet_v2_1.0_224/weights_manifest.json';\nconst model = await tf.loadFrozenModel(GOOGLE_CLOUD_STORAGE_DIR + MODEL_URL,\n GOOGLE_CLOUD_STORAGE_DIR + WEIGHTS_URL);\nconst zeros = tf.zeros([1, 224, 224, 3]);\nmodel.predict(zeros).print();\n```", 61 | "fileName": "#288", 62 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.6.0/src/executor/frozen_model.ts#L288-L294", 63 | "isFunction": true 64 | } 65 | ] 66 | } 67 | ] 68 | } 69 | ] 70 | }, 71 | "docLinkAliases": {} 72 | } -------------------------------------------------------------------------------- /source/_data/api/0.13.3/tfjs-converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "headings": [ 4 | { 5 | "name": "Models", 6 | "description": "", 7 | "subheadings": [ 8 | { 9 | "name": "Classes", 10 | "symbols": [ 11 | { 12 | "docInfo": { 13 | "heading": "Models", 14 | "subheading": "Classes" 15 | }, 16 | "symbolName": "FrozenModel", 17 | "documentation": "A `FrozenModel` is a directed, acyclic graph of built from\nSavedModel GraphDef and allows inference exeuction.", 18 | "fileName": "#32", 19 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.6.5/src/executor/frozen_model.ts#L32-L260", 20 | "methods": [], 21 | "isClass": true, 22 | "inheritsFrom": "tfc.InferenceModel" 23 | } 24 | ] 25 | }, 26 | { 27 | "name": "Loading", 28 | "symbols": [ 29 | { 30 | "docInfo": { 31 | "heading": "Models", 32 | "subheading": "Loading" 33 | }, 34 | "symbolName": "loadFrozenModel", 35 | "paramStr": "(modelUrl, weightsManifestUrl, requestOption?)", 36 | "parameters": [ 37 | { 38 | "name": "modelUrl", 39 | "documentation": "url for the model file generated by scripts/convert.py\nscript.", 40 | "type": "string", 41 | "optional": false, 42 | "isConfigParam": false 43 | }, 44 | { 45 | "name": "weightsManifestUrl", 46 | "documentation": "", 47 | "type": "string", 48 | "optional": false, 49 | "isConfigParam": false 50 | }, 51 | { 52 | "name": "requestOption", 53 | "documentation": "options for Request, which allows to send credentials\nand custom headers.", 54 | "type": "RequestInit", 55 | "optional": true, 56 | "isConfigParam": false 57 | } 58 | ], 59 | "returnType": "Promise", 60 | "documentation": "Load the frozen model through url.\n\nExample of loading the MobileNetV2 model and making a prediction with a zero\ninput.\n\n```js\nconst GOOGLE_CLOUD_STORAGE_DIR =\n 'https://storage.googleapis.com/tfjs-models/savedmodel/';\nconst MODEL_URL = 'mobilenet_v2_1.0_224/tensorflowjs_model.pb';\nconst WEIGHTS_URL =\n 'mobilenet_v2_1.0_224/weights_manifest.json';\nconst model = await tf.loadFrozenModel(GOOGLE_CLOUD_STORAGE_DIR + MODEL_URL,\n GOOGLE_CLOUD_STORAGE_DIR + WEIGHTS_URL);\nconst zeros = tf.zeros([1, 224, 224, 3]);\nmodel.predict(zeros).print();\n```", 61 | "fileName": "#288", 62 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.6.5/src/executor/frozen_model.ts#L288-L294", 63 | "isFunction": true 64 | } 65 | ] 66 | } 67 | ] 68 | } 69 | ] 70 | }, 71 | "docLinkAliases": {} 72 | } -------------------------------------------------------------------------------- /source/faq/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: faq 3 | date: 2018-03-19 17:38:08 4 | bannerText: Frequently Asked Questions 5 | --- 6 | 7 | ## Does TensorFlow.js support Node.js? 8 | 9 | Yes! We recently released node.js bindings for TensorFlow. This allows the same JavaScript code to work on both the browser and node.js, while binding to the underlying TensorFlow C implementation in node. You can follow it's development [on GitHub](https://github.com/tensorflow/tfjs-node) or try out our [NPM package](https://www.npmjs.com/package/@tensorflow/tfjs-node) 10 | 11 | ## Can I import a TensorFlow or Keras model into the browser? 12 | 13 | Yes! We have two tutorials for importing TensorFlow models. One for the [TensorFlow SavedModel](https://github.com/tensorflow/tfjs-converter) format, and one for importing [Keras HDF5 models](../tutorials/import-keras.html). 14 | 15 | ## Can I export my model from the browser? 16 | 17 | Since Version 0.11.1, you can export the topology and weights of `tf.Model`s to, or load them back 18 | from, browser Local Storage and IndexedDB. You can also trigger downloading of `tf.Model`s as 19 | files or load `tf.Model`s from user-selected files in the browser. In addition, `tf.Model`s can be 20 | sent to HTTP servers through `multipart/form-data` requests. See the 21 | [tutorial page](../tutorials/model-save-load.html) for more details. 22 | 23 | We are currently working on these additional features for model import/export: 24 | * Exporting and importing models in Node.js 25 | * Exporting `tf.FrozenModel`s (i.e., models converted from TensorFlow `SavedModel`s). 26 | 27 | ## How does this relate to TensorFlow? 28 | 29 | TensorFlow.js has an API similar to the TensorFlow Python API, however it does not support all of the functionality of the TensorFlow Python API. We are working hard to achieve API parity where it makes sense but also strive to provide an idiomatic JS API. 30 | 31 | ## How does TensorFlow.js performance compare to the Python version? 32 | 33 | In our experience, for inference, TensorFlow.js with WebGL is 1.5-2x slower than TensorFlow Python with AVX. For training, we have seen small models train faster in the browser and large models train up to 10-15x slower in the browser, compared to TensorFlow Python with AVX. 34 | 35 | Please take a look at [this benchmark](https://github.com/tensorflow/tfjs-layers/blob/master/integration_tests/benchmarks/index.html) to get more detailed performance measurements. 36 | 37 | ## What is the difference between TensorFlow.js and deeplearn.js? 38 | 39 | TensorFlow.js is an ecosystem of JavaScript tools for machine learning that evolved from deeplearn.js. deeplearn.js is now called TensorFlow.js Core. TensorFlow.js also includes a Layers API—a higher level library for building machine learning models—as well as tools for automatically porting TensorFlow SavedModels and Keras HDF5 models. 40 | 41 | ## I still have some questions 42 | 43 | Please feel free to look at our [issues tracker](https://github.com/tensorflow/tfjs/issues) and file a bug there. We also have a community mailing list for people to ask questions, get technical help, and share what they are doing with TensorFlow.js! To keep up to date with TensorFlow.js news follow us on twitter or join the announcement only mailing list. 44 | 45 | -------------------------------------------------------------------------------- /source/tutorials/import-keras.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: import-keras 3 | date: 2018-03-22 16:04:23 4 | --- 5 | 6 | # Importing a Keras model into TensorFlow.js 7 | 8 | Keras models (typically created via the Python API) may be saved in [one of several formats](https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model). The "whole model" format can be converted to TensorFlow.js Layers format, which can be loaded directly into TensorFlow.js for inference or for further training. 9 | 10 | The target TensorFlow.js Layers format is a directory containing a `model.json` file and a set of sharded weight files in binary format. The `model.json` file contains both the model topology (aka "architecture" or "graph": a description of the layers and how they are connected) and a manifest of the weight files. 11 | 12 | ## Requirements 13 | The conversion procedure requires a Python environment; you may want to keep an isolated one using [pipenv](https://github.com/pypa/pipenv) or [virtualenv](https://virtualenv.pypa.io). To install the converter, use `pip install tensorflowjs`. 14 | 15 | Importing a Keras model into TensorFlow.js is a two-step process. First, convert an existing Keras model to TF.js Layers format, and then load it into TensorFlow.js. 16 | 17 | ## Step 1. Convert an existing Keras model to TF.js Layers format 18 | 19 | Keras models are usually saved via `model.save(filepath)`, which produces a single HDF5 (.h5) file containing both the model topology and the weights. To convert such a file to TF.js Layers format, run the following command, where _`path/to/my_model.h5`_ is the source Keras .h5 file and _`path/to/tfjs_target_dir`_ is the target output directory for the TF.js files: 20 | 21 | 22 | ```sh 23 | # bash 24 | 25 | tensorflowjs_converter --input_format keras \ 26 | path/to/my_model.h5 \ 27 | path/to/tfjs_target_dir 28 | ``` 29 | 30 | ## Alternative: Use the Python API to export directly to TF.js Layers format 31 | 32 | If you have a Keras model in Python, you can export it directly to the TensorFlow.js Layers format as follows: 33 | 34 | ```py 35 | # Python 36 | 37 | import tensorflowjs as tfjs 38 | 39 | def train(...): 40 | model = keras.models.Sequential() # for example 41 | ... 42 | model.compile(...) 43 | model.fit(...) 44 | tfjs.converters.save_keras_model(model, tfjs_target_dir) 45 | ``` 46 | 47 | ## Step 2: Load the model into TensorFlow.js 48 | 49 | Use a web server to serve the converted model files you generated in Step 1. Note that you may need to configure your server to [allow Cross-Origin Resource Sharing (CORS)](https://enable-cors.org/), in order to allow fetching the files in JavaScript. 50 | 51 | Then load the model into TensorFlow.js by providing the URL to the model.json file: 52 | 53 | ```js 54 | // JavaScript 55 | 56 | import * as tf from '@tensorflow/tfjs'; 57 | 58 | const model = await tf.loadModel('https://foo.bar/tfjs_artifacts/model.json'); 59 | ``` 60 | 61 | Now the model is ready for inference, evaluation, or re-training. For instance, the loaded model can be immediately used to make a prediction: 62 | 63 | ```js 64 | // JavaScript 65 | 66 | const example = tf.fromPixels(webcamElement); // for example 67 | const prediction = model.predict(example); 68 | ``` 69 | 70 | Many of the [TensorFlow.js Examples](https://github.com/tensorflow/tfjs-examples) take this approach, using pretrained models that have been converted and hosted on Google Cloud Storage. 71 | 72 | Note that you refer to the entire model using the `model.json` filename. `loadModel(...)` fetches `model.json`, and then makes additional HTTP(S) requests to obtain the sharded weight files referenced in the `model.json` weight manifest. This approach allows all of these files to be cached by the browser (and perhaps by additional caching servers on the internet), because the `model.json` and the weight shards are each smaller than the typical cache file size limit. Thus a model is likely to load more quickly on subsequent occasions. 73 | 74 | ## Supported features 75 | 76 | TensorFlow.js Layers currently only supports Keras models using standard Keras constructs. 77 | Models using unsupported ops or layers—e.g. custom layers, Lambda layers, custom losses, or custom metrics—cannot be automatically imported, because they depend on Python code that cannot be reliably translated into JavaScript. 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # js.tensorflow.org 2 | 3 | This repo is for the website for TensorFlow.js. The site is built using Hexo (a static site generator) that puts static assets in to the `public` folder. 4 | 5 | ## Development Setup 6 | 7 | You need node.js, yarn, and git to use this repo effectively. Note that it clones the repos for tfjs-core and tfjs-layers (as git submodules) in order to build API docs. 8 | 9 | After checking out this repo run 10 | 11 | ``` 12 | yarn prep 13 | ``` 14 | 15 | This will download the two git submodules (or if you have already downloaded them before **will pull down changes from master**) and then install the project dependencies. `yarn prep` does the following: ``. Once this is done run 16 | 17 | ``` 18 | yarn serve 19 | ``` 20 | 21 | To start a dev server for the site. You should be able to make changes to the site and see them reflected in the dev server 22 | 23 | When you pull new commits from git you should run `yarn prep` again. 24 | 25 | ## Making Changes 26 | 27 | There are two broad classes of changes you might want to make, site content/design and API documentation changes. 28 | 29 | ### Site Content/Design 30 | 31 | Page layouts are stored in a custom hexo theme in the `themes/dljs` folder. This is also where JavaScript that will be included in pages is stored. Page content is written in markdown and stored in the `source` folder (though pages with complex layout define most of their content in a layout file). 32 | 33 | Changing files in these two locations should immediately be reflected in the dev server when using `yarn serve`. 34 | 35 | ### API Documentation 36 | 37 | Updating the API docs is a bit more involved as they are built from the sources of tfjs-core and tfjs-layers. The template for api docs is `api.hbs` and each version of the docs has a corresponding folder in `_data`. Files in `_data` are automatically generated and shouldn't be edited. 38 | 39 | To edit the docs and see changes reflected in the site you can edit the repositories that are located in `libs`. Note that these submodules behave like *regular git repositories* and have an origin pointing to the canonical repository for `tfjs-core` and `tfjs-layers`. Making an API doc change involves making a commit to the subproject repo and to this one. You may need to add a new git remote in the submodule if you want to make a PR from a fork of tfjs-website repo. Make sure to do `git checkout master` or make a new branch for your changes. 40 | 41 | There are two ways to regenerate the docs json. 42 | 43 | During local development (e.g. if you have changes in libs), run: 44 | 45 | ``` 46 | yarn build-api 47 | ``` 48 | 49 | This will build a version of the api known as `local`. It will be accessible at `http://localhost:4000/api/local/`. This content is not checked in, nor is it linked to 50 | anywhere on the site, but it is suitable for testing changes to docs. 51 | 52 | Once the your changes have been accepted into the repo in question (either tfjs-core or tfjs-layers), you can run `yarn prep` again in this repo (tfjs-website) to sync everything up (pull the most recent commits from master for each). You can then commit the **new submodule info** in the tfjs-website repo. 53 | 54 | Once you are done you can do a full production build of the site using: 55 | 56 | ``` 57 | yarn build-prod 58 | ``` 59 | 60 | Note that this command will do a number of things that will **modify your working tree**. Its purpose is to build a new production build suitable for deployment to the site, as such it only builds docs that are in a released version of tfjs-layers and tfjs-core. The version it builds is driven off of the `@tensorflow/tfjs` dependency in package.json. **Build prod cannot build your local doc changes into the site**. To do this it will do a checkout of `libs/tfjs-core` and `libs/tfjs-layers` that correspond to the dependencies listed for `@tensorflow/tfjs`. This will modify your working tree (in libs). 61 | 62 | In both these cases starting the dev server and refreshing the page should allow you to see changes. 63 | 64 | In addition to `http://localhost:4000/api/local/`, the build also provides `http://localhost:4000/api/latest/` which points to the last **production** version of the docs that have been built. `latest` will never point to `local` 65 | 66 | 67 | ### Deployment 68 | 69 | To build the site run 70 | 71 | ``` 72 | yarn build-prod 73 | ``` 74 | 75 | Deployment instructions are available internally. Contact @tafsiri for access. (Googlers only) 76 | -------------------------------------------------------------------------------- /source/_data/api/0.14.1/tfjs-converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "headings": [ 4 | { 5 | "name": "Models", 6 | "description": "", 7 | "subheadings": [ 8 | { 9 | "name": "Classes", 10 | "symbols": [ 11 | { 12 | "docInfo": { 13 | "heading": "Models", 14 | "subheading": "Classes" 15 | }, 16 | "symbolName": "FrozenModel", 17 | "documentation": "A `tf.FrozenModel` is a directed, acyclic graph of built from\nSavedModel GraphDef and allows inference exeuction.", 18 | "fileName": "#35", 19 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.7.1/src/executor/frozen_model.ts#L35-L265", 20 | "methods": [], 21 | "isClass": true, 22 | "inheritsFrom": "tfc.InferenceModel" 23 | } 24 | ] 25 | }, 26 | { 27 | "name": "Loading", 28 | "symbols": [ 29 | { 30 | "docInfo": { 31 | "heading": "Models", 32 | "subheading": "Loading" 33 | }, 34 | "symbolName": "loadFrozenModel", 35 | "paramStr": "(modelUrl, weightsManifestUrl, requestOption?)", 36 | "parameters": [ 37 | { 38 | "name": "modelUrl", 39 | "documentation": "url for the model file generated by scripts/convert.py\nscript.", 40 | "type": "string", 41 | "optional": false, 42 | "isConfigParam": false 43 | }, 44 | { 45 | "name": "weightsManifestUrl", 46 | "documentation": "", 47 | "type": "string", 48 | "optional": false, 49 | "isConfigParam": false 50 | }, 51 | { 52 | "name": "requestOption", 53 | "documentation": "options for Request, which allows to send credentials\nand custom headers.", 54 | "type": "RequestInit", 55 | "optional": true, 56 | "isConfigParam": false 57 | } 58 | ], 59 | "returnType": "Promise", 60 | "documentation": "Load the frozen model through url.\n\nExample of loading the MobileNetV2 model and making a prediction with a zero\ninput.\n\n```js\nconst GOOGLE_CLOUD_STORAGE_DIR =\n 'https://storage.googleapis.com/tfjs-models/savedmodel/';\nconst MODEL_URL = 'mobilenet_v2_1.0_224/tensorflowjs_model.pb';\nconst WEIGHTS_URL =\n 'mobilenet_v2_1.0_224/weights_manifest.json';\nconst model = await tf.loadFrozenModel(GOOGLE_CLOUD_STORAGE_DIR + MODEL_URL,\n GOOGLE_CLOUD_STORAGE_DIR + WEIGHTS_URL);\nconst zeros = tf.zeros([1, 224, 224, 3]);\nmodel.predict(zeros).print();\n```", 61 | "fileName": "#293", 62 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.7.1/src/executor/frozen_model.ts#L293-L299", 63 | "isFunction": true 64 | }, 65 | { 66 | "docInfo": { 67 | "heading": "Models", 68 | "subheading": "Loading" 69 | }, 70 | "symbolName": "loadTfHubModule", 71 | "paramStr": "(tfhubModuleUrl, requestOption?)", 72 | "parameters": [ 73 | { 74 | "name": "tfhubModuleUrl", 75 | "documentation": "", 76 | "type": "string", 77 | "optional": false, 78 | "isConfigParam": false 79 | }, 80 | { 81 | "name": "requestOption", 82 | "documentation": "options for Request, which allows to send credentials\nand custom headers.", 83 | "type": "RequestInit", 84 | "optional": true, 85 | "isConfigParam": false 86 | } 87 | ], 88 | "returnType": "Promise", 89 | "documentation": "Load the frozen model hosted by TF-Hub.\n\nExample of loading the MobileNetV2 model and making a prediction with a zero\ninput.\n\n```js\nconst TFHUB_MOBILENET =\n 'https://tfhub.dev/google/imagenet/mobilenet_v2_140_224/classification/2';\nconst model = await tf.loadTfHubModule(TFHUB_MOBILENET);\nconst zeros = tf.zeros([1, 224, 224, 3]);\nmodel.predict(zeros).print();\n```", 90 | "fileName": "#321", 91 | "githubUrl": "https://github.com/tensorflow/tfjs-converter/blob/v0.7.1/src/executor/frozen_model.ts#L321-L330", 92 | "isFunction": true 93 | } 94 | ] 95 | } 96 | ] 97 | } 98 | ] 99 | }, 100 | "docLinkAliases": {} 101 | } -------------------------------------------------------------------------------- /themes/dljs/source/js/codeSnippets.js: -------------------------------------------------------------------------------- 1 | // There isn't a standard way to get line numbers reliably, we attempt to 2 | // parse out a few formats we have seen. 3 | // Note we do not use e.lineNumber as it is not reliable (especially in the 4 | // context of eval) 5 | function getLineNumber(error) { 6 | try { 7 | // firefox 8 | const firefoxRegex = /eval:(\d+):\d+/; 9 | if (error.stack.match(firefoxRegex)) { 10 | const res = error.stack.match(firefoxRegex); 11 | return parseInt(res[1], 10); 12 | } 13 | 14 | // chrome 15 | const chromeRegex = /eval.+:(\d+):\d+/; 16 | if (error.stack.match(chromeRegex)) { 17 | const res = error.stack.match(chromeRegex); 18 | return parseInt(res[1], 10); 19 | } 20 | 21 | } catch (e) { 22 | return; 23 | } 24 | 25 | // We found nothing 26 | return; 27 | } 28 | 29 | async function executeCodeSnippet(consoleLogElement, codeSnippet) { 30 | consoleLogElement.innerText = ''; 31 | var oldLog = console.log; 32 | console.log = function(...values) { 33 | let logStrs = []; 34 | for (let i = 0; i < values.length; i++) { 35 | const value = values[i]; 36 | 37 | let logStr; 38 | if (value.toString == null) { 39 | logStr = value; 40 | } else { 41 | const toStr = value.toString(); 42 | 43 | if (toStr === '[object Object]') { 44 | logStr = JSON.stringify(value, null, 2); 45 | } else { 46 | logStr = toStr; 47 | } 48 | logStrs.push(logStr); 49 | } 50 | } 51 | consoleLogElement.innerHTML += logStrs.join(' ') + '\n'; 52 | }; 53 | 54 | function reportError(e) { 55 | var errorMessage = '\n
An error occured'; 56 | var lineNumber = getLineNumber(e); 57 | if (lineNumber !== undefined) { 58 | errorMessage += ' on line: ' + lineNumber + ''; 59 | } else { 60 | errorMessage += '' 61 | } 62 | errorMessage += '
'; 63 | errorMessage += '
' + e.message + '
'; 64 | errorMessage += '
'; 65 | 66 | console.log(errorMessage); 67 | } 68 | 69 | // It is important that codeSnippet and 'try {' be on the same line 70 | // in order to not modify the line number on an error. 71 | const evalString = '(async function runner() { try { ' + codeSnippet + 72 | '} catch (e) { reportError(e); } })()'; 73 | 74 | tf.ENV.engine.startScope(); 75 | 76 | // this outer try is for errors that prevent the snippet from being parsed. 77 | try { 78 | await eval(evalString).catch(function(e) { 79 | // This catch is for errors within promises within snippets 80 | reportError(e); 81 | }); 82 | } catch (e) { 83 | reportError(e); 84 | } 85 | 86 | tf.ENV.engine.endScope(); 87 | 88 | console.log = oldLog; 89 | }; 90 | 91 | function makeEditable(codeBlock) { 92 | var parent = codeBlock.parentElement; 93 | var codeText = codeBlock.innerText; 94 | 95 | parent.innerHTML = ''; 96 | var myCodeMirror = CodeMirror(parent, { 97 | value: codeText, 98 | theme: 'railscasts', 99 | mode: 'javascript', 100 | tabSize: 2, 101 | indentUnit: 2, 102 | viewportMargin: Infinity, 103 | }); 104 | 105 | codeBlock.codeMirror = myCodeMirror; 106 | } 107 | 108 | function initCodeBlocks(selector) { 109 | // Find all the code blocks. 110 | var jsBlocks = 111 | Array.prototype.slice.call(document.querySelectorAll(selector)); 112 | 113 | jsBlocks.forEach(function(block) { 114 | var consoleElement = document.createElement('div'); 115 | consoleElement.className = 'snippet-console'; 116 | 117 | var consoleRunElement = document.createElement('button'); 118 | consoleRunElement.innerText = 'Run'; 119 | consoleRunElement.className = 'snippet-run-button'; 120 | 121 | var consoleEditElement = document.createElement('button'); 122 | consoleEditElement.innerText = 'Edit'; 123 | consoleEditElement.className = 'snippet-edit-button'; 124 | 125 | var consoleLogElement = document.createElement('div'); 126 | consoleLogElement.className = 'snippet-console-log'; 127 | 128 | consoleElement.appendChild(consoleLogElement); 129 | consoleElement.appendChild(consoleEditElement); 130 | consoleElement.appendChild(consoleRunElement); 131 | 132 | block.parentElement.insertAdjacentElement('afterend', consoleElement); 133 | 134 | consoleRunElement.addEventListener('click', function() { 135 | var consoleLogElement = 136 | this.parentElement.querySelector('.snippet-console-log'); 137 | 138 | var snippetText; 139 | if (block.codeMirror) { 140 | snippetText = block.codeMirror.getValue(); 141 | } else { 142 | snippetText = this.parentElement.previousElementSibling.innerText; 143 | } 144 | 145 | executeCodeSnippet(consoleLogElement, snippetText); 146 | }); 147 | 148 | consoleEditElement.addEventListener('click', function() { 149 | makeEditable(block); 150 | this.disabled = true; 151 | }); 152 | }); 153 | } 154 | -------------------------------------------------------------------------------- /themes/dljs/layout/layout.hbs: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | TensorFlow.js 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | {{!-- 42 | --}} 43 | 44 | 45 | 46 | 47 | 48 | 49 | {{#if (isApiPage path)}} 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {{#if (eq page.title 'local')}} 59 | 60 | {{else}} 61 | 62 | {{/if}} 63 | 64 | 65 | 66 | 67 | 68 | 69 | {{else}} 70 | 71 | 72 | {{/if}} 73 | 74 | 75 | 76 | {{!-- Header --}} 77 | {{> header }} 78 | {{!-- Content --}} 79 |
80 | {{{body}}} 81 |
82 | {{!-- Footer --}} 83 | {{> footer }} 84 | 85 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /source/tutorials/custom-webgl-op.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: custom-webgl-op 3 | date: 2018-08-02 16:07:20 4 | --- 5 | 6 | ### Sections 7 | --- 8 | * [Creating custom WebGL operations](#tutorial) 9 | * [GLSL functions provided by Tensorflow.js](#stdlib) 10 | 11 | 12 | # Creating custom WebGL operations 13 | 14 | To define custom WebGL operations, all we have to do is create an object that implements `tf.webgl.GPGPUProgram`. 15 | 16 | This interface is defined as: 17 | ```ts 18 | interface GPGPUProgram { 19 | variableNames: string[]; 20 | outputShape: number[]; 21 | userCode: string; 22 | supportsBroadcasting?: boolean; 23 | } 24 | ``` 25 | 26 | For a contrived example, lets implement an operation that computes `f(x) = x * x + x`. 27 | 28 | The GLSL code for this would be: 29 | ```glsl 30 | void main() { 31 | float x = getXAtOutCoords(); 32 | float value = x * x + x; 33 | setOutput(value); 34 | } 35 | ``` 36 | 37 | where `getXAtOutCoords` and `setOutput` are [provided by Tensorflow.js](#stdlib) to the shader. 38 | Note that the main function is called for each value in the output tensor. 39 | 40 | 41 | The full GPGPUProgram definition would be: 42 | ```js 43 | const squareAndAddKernel = inputShape => ({ 44 | variableNames: ['X'], 45 | outputShape: inputShape.slice(), 46 | userCode: ` 47 | void main() { 48 | float x = getXAtOutCoords(); 49 | float value = x * x + x; 50 | setOutput(value); 51 | } 52 | ` 53 | }) 54 | ``` 55 | 56 | To run this op, you would use `tf.ENV.backend.compileAndRun(program: GPGPUProgram, inputs: tf.Tensor[]): tf.Tensor`. Note that this will be undefined if the backend isn't the webgl backend. 57 | 58 | ```js 59 | const x = tf.tensor([1, 2, 3, 4]); 60 | const program = squareAndAddKernel(x.shape); 61 | 62 | const result = tf.ENV.backend.compileAndRun(program, [x]); 63 | ``` 64 | 65 | However, we probably also want to define the gradients for this op, so that gradients can be backpropagated through it. 66 | 67 | To do this, we use [tf.customGrad](https://js.tensorflow.org/api/latest/#customGrad). 68 | 69 | ```js 70 | const squareAndAddBackpropKernel = inputShape => ({ 71 | variableNames: ['X'], 72 | outputShape: inputShape.slice(), 73 | userCode: ` 74 | void main() { 75 | float x = getXAtOutCoords(); 76 | float value = 2.0 * x + 1.0; 77 | setOutput(value); 78 | } 79 | ` 80 | }); 81 | 82 | 83 | const squareAndAdd = tf.customGrad(x => { 84 | const backend = tf.ENV.backend; 85 | const program = squareAndAddKernel(x.shape); 86 | const backpropProgram = squareAndAddBackpropKernel(x.shape); 87 | 88 | const value = backend.compileAndRun(program, [x]); 89 | 90 | const gradFunc = dy => 91 | [backend.compileAndRun(backpropProgram, [x]).mul(dy)]; 92 | return {value, gradFunc}; 93 | }); 94 | ``` 95 | 96 | We can then use this as: 97 | 98 | ```js 99 | const x = tf.tensor([1, 2, 3, 4]); 100 | 101 | const value = squareAndAdd(x); 102 | 103 | const grads = tf.grad(x => squareAndAdd(x)); 104 | const dx = grads(x); 105 | 106 | // value == [2, 6, 12, 20] 107 | // dx == [3, 5, 7, 9] 108 | ``` 109 | 110 | Or more concisely: 111 | 112 | ```js 113 | const {value, grad} = tf.valueAndGrad(squareAndAdd)(x); 114 | ``` 115 | 116 | # GLSL functions generated by Tensorflow.js 117 | 118 | Tensorflow.js generates functions you can use to read from the input tensors and write to the output tensor, as well as additional numeric utility functions. These are prepended to your code by the [Shader Compiler](https://github.com/tensorflow/tfjs-core/blob/master/src/kernels/webgl/shader_compiler.ts). 119 | 120 | * `void setOutput(float value)` 121 | 122 | * Sets the output value for the coordinate where the fragment shader is run on (equivalent to `gl_FragCoord = vec4(value, 0.0, 0.0, 0.0)`). 123 | 124 | * `indexType getOutputCoords()` 125 | 126 | * Where `indexType` is one of `int | ivec2 | ivec3 | ivec4 | ivec5 | ivec6`. 127 | 128 | * Returns an `int` if the output tensor is rank-0 or rank-1, otherwise returns an `ivecN` where N == rank. This is the coordinate of the cell in the output tensor this program will write to. 129 | 130 | 131 | * Tensorflow.js generates GLSL functions to sample from the input tensors. These are of the form: 132 | 133 | ```glsl 134 | float get{VarName}AtOutCoords() 135 | 136 | float get{VarName}() // rank-0 input 137 | float get{VarName}(int x) // rank-1 input 138 | float get{VarName}(int x, int y) // rank-2 input 139 | float get{VarName}(int x, int y, int z) // rank-3 input 140 | float get{VarName}(int x, int y, int z, int w) // rank-4 input 141 | // continue as above for rank-5 & rank-6 142 | 143 | // For example, for rank-2 Tensor named x: 144 | // float getX(int x, int y) 145 | ``` 146 | 147 | Where `VarName` is a variable name as defined in the `variableNames` array of your `GPGPUProgram` in **with the first letter captialised**. 148 | This means that for a variable named `matrix`, TF.js will generate `getMatrix`. 149 | 150 | Many of these functions are depended on the rank of the input tensors, so in your `GPGPUProgram` you'll often want to emit different code based on the ranks of the `inputShape`s. 151 | For instance, if `get{VarName}AtOutCoords()` didn't exist, we might have written `squareAndAddKernel` as: 152 | 153 | ```js 154 | const squareAndAddKernel = inputShape => ({ 155 | const variableNames = ['X'] 156 | const outputShape = inputShape.slice() 157 | const rank = outputShape.length 158 | 159 | const coordSnippets = ['', 160 | 'coords', 161 | 'coords.x, coords.y', 162 | 'coords.x, coords.y, coords.z', 163 | 'coords.x, coords.y, coords.z, coords.w'] 164 | 165 | const coordType = rank < 2 ? 'int' : `ivec${rank}` 166 | 167 | const userCode = ` 168 | void main() { 169 | ${coordType} coords = getOutputCoords(); 170 | float x = getX(${coordSnippets[rank]}); 171 | setOutput(x * x + x); 172 | }` 173 | 174 | return {variableNames, outputShape, userCode} 175 | }) 176 | ``` 177 | 178 | * `bool isNaN(float val)` 179 | 180 | * `true` if val is a `NaN`, otherwise false. 181 | 182 | * `int round(float value)` 183 | 184 | * Round `value` to the nearest integer. 185 | 186 | * `int imod(int x, int y)` 187 | 188 | * Same as `float mod(float x, float y)` but for ints, since GLSL doesn't provide us one. 189 | 190 | * `float random(float seed)` 191 | 192 | * Returns a pseudo-random number, based on Dave Hoskins's formula in https://www.shadertoy.com/view/4djSRW. 193 | 194 | -------------------------------------------------------------------------------- /source/tutorials/import-saved-model.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: import-saved-model 3 | date: 2018-06-13 12:33:23 4 | --- 5 | 6 | # Importing a TensorFlow GraphDef based Models into TensorFlow.js 7 | 8 | TensorFlow GraphDef based models (typically created via the Python API) may be saved in one of following formats: 9 | 1. TensorFlow [SavedModel](https://www.tensorflow.org/programmers_guide/saved_model#overview_of_saving_and_restoring_models) 10 | 2. [Frozen Model](https://www.tensorflow.org/mobile/prepare_models#how_do_you_get_a_model_you_can_use_on_mobile) 11 | 3. [Session Bundle](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/session_bundle/README.md) 12 | 4. [Tensorflow Hub module](https://www.tensorflow.org/hub/) 13 | 14 | All of above formats can be converted by [TensorFlow.js converter](https://github.com/tensorflow/tfjs-converter) to TensorFlow.js web friendly format, which can be loaded directly into TensorFlow.js for inference. 15 | 16 | (Note: TensorFlow has deprecated session bundle format, please migrate your models to SavedModel format.) 17 | 18 | ## Requirements 19 | The conversion procedure requires a Python environment; you may want to keep an isolated one using [pipenv](https://github.com/pypa/pipenv) or [virtualenv](https://virtualenv.pypa.io). To install the converter, and run following: 20 | 21 | ```bash 22 | pip install tensorflowjs 23 | ``` 24 | 25 | Importing a TensorFlow models into TensorFlow.js is a two-step process. First, convert an existing model to TensorFlow.js web format, and then load it into TensorFlow.js. 26 | 27 | ## Step 1. Convert an existing TensorFlow model to TensorFlow.js Web format 28 | 29 | Run the converter script provided by the pip package: 30 | 31 | Usage: 32 | SavedModel example: 33 | 34 | ```bash 35 | tensorflowjs_converter \ 36 | --input_format=tf_saved_model \ 37 | --output_node_names='MobilenetV1/Predictions/Reshape_1' \ 38 | --saved_model_tags=serve \ 39 | /mobilenet/saved_model \ 40 | /mobilenet/web_model 41 | ``` 42 | 43 | Frozen model example: 44 | 45 | ```bash 46 | tensorflowjs_converter \ 47 | --input_format=tf_frozen_model \ 48 | --output_node_names='MobilenetV1/Predictions/Reshape_1' \ 49 | /mobilenet/frozen_model.pb \ 50 | /mobilenet/web_model 51 | ``` 52 | 53 | Session bundle model example: 54 | 55 | ```bash 56 | tensorflowjs_converter \ 57 | --input_format=tf_session_bundle \ 58 | --output_node_names='MobilenetV1/Predictions/Reshape_1' \ 59 | /mobilenet/session_bundle \ 60 | /mobilenet/web_model 61 | ``` 62 | 63 | Tensorflow Hub module example: 64 | 65 | ```bash 66 | tensorflowjs_converter \ 67 | --input_format=tf_hub \ 68 | 'https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/classification/1' \ 69 | /mobilenet/web_model 70 | ``` 71 | 72 | |Positional Arguments | Description | 73 | |---|---| 74 | |`input_path` | Full path of the saved model directory, session bundle directory, frozen model file or TensorFlow Hub module handle or path.| 75 | |`output_path` | Path for all output artifacts.| 76 | 77 | | Options | Description 78 | |---|---| 79 | |`--input_format` | The format of input model, use tf_saved_model for SavedModel, tf_frozen_model for frozen model, tf_session_bundle for session bundle, tf_hub for TensorFlow Hub module and keras for Keras HDF5. | 80 | |`--output_node_names`| The names of the output nodes, separated by commas.| 81 | |`--saved_model_tags` | Only applicable to SavedModel conversion, Tags of the MetaGraphDef to load, in comma separated format. Defaults to `serve`.| 82 | |`--signature_name` | Only applicable to TensorFlow Hub module conversion, signature to load. Defaults to `default`. See https://www.tensorflow.org/hub/common_signatures/.| 83 | 84 | Use following command to get the detail help message: 85 | 86 | ```bash 87 | tensorflowjs_converter --help 88 | ``` 89 | 90 | ### Converter generated files 91 | 92 | The conversion script above produces 3 types of files: 93 | 94 | * `web_model.pb` (the dataflow graph) 95 | * `weights_manifest.json` (weight manifest file) 96 | * `group1-shard\*of\*` (collection of binary weight files) 97 | 98 | For example, here is the MobileNet model converted and served in 99 | following location: 100 | 101 | ```html 102 | https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/optimized_model.pb 103 | https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/weights_manifest.json 104 | https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/group1-shard1of5 105 | ... 106 | https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/group1-shard5of5 107 | ``` 108 | 109 | ## Step 2: Loading and running in the browser 110 | 111 | 1. Install the tfjs-converter npm package 112 | 113 | `yarn add @tensorflow/tfjs` or `npm install @tensorflow/tfjs` 114 | 115 | 2. Instantiate the [FrozenModel class](https://github.com/tensorflow/tfjs-converter/blob/master/src/executor/frozen_model.ts) and run inference. 116 | 117 | ```js 118 | import * as tf from '@tensorflow/tfjs'; 119 | import {loadFrozenModel} from '@tensorflow/tfjs-converter'; 120 | 121 | const MODEL_URL = 'https://.../mobilenet/web_model.pb'; 122 | const WEIGHTS_URL = 'https://.../mobilenet/weights_manifest.json'; 123 | 124 | const model = await loadFrozenModel(MODEL_URL, WEIGHTS_URL); 125 | const cat = document.getElementById('cat'); 126 | model.execute({input: tf.fromPixels(cat)}); 127 | ``` 128 | 129 | Check out our working [MobileNet demo](https://github.com/tensorflow/tfjs-converter/tree/master/demo/mobilenet). 130 | 131 | If your server requests credentials for accessing the model files, you can provide the optional RequestOption param, which will be directly passed to the fetch function call. 132 | 133 | ```js 134 | const model = await loadFrozenModel(MODEL_URL, WEIGHTS_URL, 135 | {credentials: 'include'}); 136 | ``` 137 | 138 | Please see [fetch() documentation](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch) for details. 139 | 140 | ## Supported operations 141 | 142 | Currently TensorFlow.js only supports a limited set of TensorFlow Ops. See the 143 | [full list](https://github.com/tensorflow/tfjs-converter/blob/master/docs/supported_ops.md). 144 | If your model uses any unsupported ops, the `tensorflowjs_converter` script will fail and 145 | produce a list of the unsupported ops in your model. Please file [issues](https://github.com/tensorflow/tfjs/issues) to let us 146 | know what ops you need support for. 147 | 148 | ## Loading the weights only 149 | 150 | If you prefer to load the weights only, you can use follow code snippet. 151 | 152 | ```js 153 | import * as tf from '@tensorflow/tfjs'; 154 | 155 | const weightManifestUrl = "https://example.org/model/weights_manifest.json"; 156 | 157 | const manifest = await fetch(weightManifestUrl); 158 | this.weightManifest = await manifest.json(); 159 | const weightMap = await tf.io.loadWeights( 160 | this.weightManifest, "https://example.org/model"); 161 | -------------------------------------------------------------------------------- /source/demos/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: all-demos 3 | align: center 4 | date: 2018-12-10 10:38:08 5 | bannerText: All Demos 6 | --- 7 | 8 | {% raw %} 9 | 10 |
11 |
12 |
13 |
14 | 17 |
18 | Use your phone’s camera to identify emojis in the real world. Can you find all the emojis before time 19 | expires? 20 |
21 | 22 | 30 |
31 | 32 |
33 | 34 |
35 |
36 | 41 |
42 | Play Pac-Man using images trained in your browser. 43 |
44 | 45 | 53 |
54 | 55 |
56 | 57 |
58 |
59 | 64 |
65 | No coding required! Teach a machine to recognize images and play sounds. 66 |
67 | 68 | 76 |
77 | 78 |
79 | 80 |
81 |
82 | 87 |
88 | Enjoy a real-time piano performance by a neural network 89 |
90 | 91 | 99 |
100 | 101 |
102 | 103 |
104 |
105 | 110 |
111 | Real-time 112 | Human Pose Estimation in the browser. 114 |
115 | 116 | 124 |
125 | 126 |
127 | 128 |
129 |
130 | 135 |
136 | Train a server-side model to classify baseball pitch types using Node.js. 137 |
138 | 139 |
140 | 141 | 142 | 143 |
144 |
145 | 146 |
147 | 148 |
149 |
150 | 155 |
156 | A collection of over 15 short examples 157 | of different deep learning tasks. These examples 158 | can be great starting points for your own projects. 159 |

160 | Also check out the gallery 161 | to see what others in 162 | the community have created with TensorFlow.js. 163 |

164 |
165 | 166 |
167 | 168 | 169 | 170 |
171 |
172 | 173 |
174 |
175 |
176 | 177 | {% endraw %} 178 | -------------------------------------------------------------------------------- /source/_data/api/0.6.1/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "for details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Basic", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Convolutional", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Merge", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Normalization", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Pooling", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Recurrent", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Wrapper", 103 | "description": [] 104 | } 105 | ] 106 | }, 107 | { 108 | "name": "Operations", 109 | "description": [], 110 | "subheadings": [ 111 | { 112 | "name": "Arithmetic", 113 | "description": ["

To perform mathematical computation on Tensors, we use", 114 | "operations. Tensors are immutable, so all operations always return", 115 | "new Tensors and never modify input Tensors.

"], 116 | "pin": ["add", "sub", "mul", "div"] 117 | }, 118 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 119 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 120 | {"name": "RNN"}, {"name": "Logical"} 121 | ] 122 | }, 123 | { 124 | "name": "Training", 125 | "description": ["

We also provide an API to do perform training, and", 126 | "compute gradients. We compute gradients eagerly, users provide a function", 127 | "that is a combination of operations and we automatically differentiate", 128 | "that function's output with respect to its inputs.", 129 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 130 | "the TensorFlow Eager API.", 131 | "

"], 132 | "subheadings": [ 133 | { 134 | "name": "Gradients", 135 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 136 | }, 137 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 138 | {"name": "Losses"}, {"name": "Classes"} 139 | ] 140 | }, 141 | { 142 | "name": "Performance", 143 | "description": [], 144 | "subheadings": 145 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 146 | }, 147 | { 148 | "name": "Environment", 149 | "description": ["

TensorFlow.js can run mathematical operations on", 150 | "different backends. Currently, we support WebGL and JavaScript", 151 | "CPU. By default, we choose the 'best' backend available, but", 152 | "allow users to customize their backend.

"], 153 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 154 | }, 155 | { 156 | "name": "Constraints", 157 | "description": ["

Constraints are added to attributes", 158 | "of a Layer (such as weights, kernels, or biases) at", 159 | "construction time to clamp, or otherwise enforce an allowed range,", 160 | "of values for different components of the Layer.

"], 161 | "subheadings": [{"name": ""}] 162 | }, 163 | { 164 | "name": "Initializers", 165 | "description": ["

Initializers are used in Layers", 166 | "to establish the starting the values of weights, biases, kernels, ", 167 | "etc.

"], 168 | "subheadings": [{"name": ""}] 169 | }, 170 | { 171 | "name": "Regularizers", 172 | "description": ["

Regularizers can be attached to various components", 173 | "of a Layer to add a 'scoring' function to help drive weights, or ", 174 | "other trainable values, away from excessively large values. They're", 175 | "typically used to promote a notion that a 'simpler' model is better", 176 | "than a complicated model, assuming equal performance.

"], 177 | "subheadings": [{"name": ""}] 178 | } 179 | 180 | ] 181 | -------------------------------------------------------------------------------- /source/_data/api/0.10.0/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.11.1/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.11.2/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.11.6/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.8.0/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.9.0/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.7.0/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "for details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.11.7/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d", "tensor5d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /source/_data/api/0.12.0/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": ["

Tensors are the core datastructure of TensorFlow.js", 5 | "They are a generalization of vectors and matrices to potentially", 6 | "higher dimensions.

"], 7 | "subheadings": [ 8 | { 9 | "name": "Creation", 10 | "description": [ 11 | "

We have utility functions for common cases like Scalar, 1D,", 12 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 13 | "tensors in ways useful for machine learning.

"], 14 | "pin": [ 15 | "tensor", "scalar", "tensor1d", "tensor2d", "tensor3d", "tensor4d", "tensor5d" 16 | ] 17 | }, 18 | { 19 | "name": "Classes", 20 | "description": ["

", 21 | "This section shows the main Tensor related classes in TensorFlow.js and", 22 | "the methods we expose on them.", 23 | "

"], 24 | "pin": ["Tensor", "Variable", "TensorBuffer"] 25 | }, 26 | { 27 | "name": "Transformations", 28 | "description": ["

This section describes some common Tensor", 29 | "transformations for reshaping and type-casting.

"] 30 | }, 31 | { 32 | "name": "Slicing and Joining", 33 | "description": ["

TensorFlow.js provides several operations", 34 | "to slice or extract parts of a tensor, or join multiple", 35 | "tensors together."] 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "Models", 41 | "description": ["

Models are one of the primary abstractions used in", 42 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 43 | "for prediction. A model's state (topology, and optionally, trained", 44 | "weights) can be restored from various formats.

", 45 | "

Models are a collection of Layers, see Model Creation for", 46 | "details about how Layers can be connected.

"], 47 | "subheadings": [ 48 | { 49 | "name": "Creation", 50 | "description": ["

There are two primary ways of creating models.

", 51 | ""], 57 | "pin": ["sequential", "model"] 58 | }, 59 | { 60 | "name": "Inputs", 61 | "description": [] 62 | }, 63 | { 64 | "name": "Loading", 65 | "description": [] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Layers", 71 | "description": ["

Layers are the primary building block for ", 72 | "constructing a Model. Each layer will typically perform some", 73 | "computation to transform its input to its output.

", 74 | "

Layers will automatically take care of creating and initializing", 75 | "the various internal variables/weights they need to function.

"], 76 | "subheadings": [ 77 | { 78 | "name": "Advanced Activation", 79 | "description": [] 80 | }, 81 | { 82 | "name": "Basic", 83 | "description": [] 84 | }, 85 | { 86 | "name": "Convolutional", 87 | "description": [] 88 | }, 89 | { 90 | "name": "Merge", 91 | "description": [] 92 | }, 93 | { 94 | "name": "Normalization", 95 | "description": [] 96 | }, 97 | { 98 | "name": "Pooling", 99 | "description": [] 100 | }, 101 | { 102 | "name": "Recurrent", 103 | "description": [] 104 | }, 105 | { 106 | "name": "Wrapper", 107 | "description": [] 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "Operations", 113 | "description": [], 114 | "subheadings": [ 115 | { 116 | "name": "Arithmetic", 117 | "description": ["

To perform mathematical computation on Tensors, we use", 118 | "operations. Tensors are immutable, so all operations always return", 119 | "new Tensors and never modify input Tensors.

"], 120 | "pin": ["add", "sub", "mul", "div"] 121 | }, 122 | {"name": "Basic math"}, {"name": "Matrices"}, {"name": "Convolution"}, 123 | {"name": "Reduction"}, {"name": "Normalization"}, {"name": "Images"}, 124 | {"name": "RNN"}, {"name": "Logical"} 125 | ] 126 | }, 127 | { 128 | "name": "Training", 129 | "description": ["

We also provide an API to do perform training, and", 130 | "compute gradients. We compute gradients eagerly, users provide a function", 131 | "that is a combination of operations and we automatically differentiate", 132 | "that function's output with respect to its inputs.", 133 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 134 | "the TensorFlow Eager API.", 135 | "

"], 136 | "subheadings": [ 137 | { 138 | "name": "Gradients", 139 | "pin": ["grad", "grads", "valAndGrad", "valAndGrads", "customGrad"] 140 | }, 141 | {"name": "Optimizers", "pin": ["sgd", "momentum", "adagrad", "adadelta"]}, 142 | {"name": "Losses"}, {"name": "Classes"} 143 | ] 144 | }, 145 | { 146 | "name": "Performance", 147 | "description": [], 148 | "subheadings": 149 | [{"name": "Memory", "pin": ["tidy"]}, {"name": "Timing", "pin": ["time"]}] 150 | }, 151 | { 152 | "name": "Environment", 153 | "description": ["

TensorFlow.js can run mathematical operations on", 154 | "different backends. Currently, we support WebGL and JavaScript", 155 | "CPU. By default, we choose the 'best' backend available, but", 156 | "allow users to customize their backend.

"], 157 | "subheadings": [{"name": "", "pin": ["setBackend"]}] 158 | }, 159 | { 160 | "name": "Constraints", 161 | "description": ["

Constraints are added to attributes", 162 | "of a Layer (such as weights, kernels, or biases) at", 163 | "construction time to clamp, or otherwise enforce an allowed range,", 164 | "of values for different components of the Layer.

"], 165 | "subheadings": [{"name": ""}] 166 | }, 167 | { 168 | "name": "Initializers", 169 | "description": ["

Initializers are used in Layers", 170 | "to establish the starting the values of weights, biases, kernels, ", 171 | "etc.

"], 172 | "subheadings": [{"name": ""}] 173 | }, 174 | { 175 | "name": "Regularizers", 176 | "description": ["

Regularizers can be attached to various components", 177 | "of a Layer to add a 'scoring' function to help drive weights, or ", 178 | "other trainable values, away from excessively large values. They're", 179 | "typically used to promote a notion that a 'simpler' model is better", 180 | "than a complicated model, assuming equal performance.

"], 181 | "subheadings": [{"name": ""}] 182 | } 183 | 184 | ] 185 | -------------------------------------------------------------------------------- /themes/dljs/layout/setup.hbs: -------------------------------------------------------------------------------- 1 | {{#if page.bannerText}} 2 |
3 |

{{page.bannerText}}

4 |
5 | {{/if}} 6 | 7 | 25 | 26 | 46 | 47 | 70 | {{!-- // clang-format on --}} 71 | 72 |
73 |
74 |
75 |

Browser setup

76 | 77 |

78 | There are two main ways to get TensorFlow.js in your browser based projects: via 79 | 80 | script tags 81 | or by installing it from 82 | NPM 83 | and using a build tool like 84 | Parcel, 85 | WebPack, or 86 | Rollup. 87 |

88 | 89 |

90 | If you are new to web development, or have never heard of tools like webpack or parcel, we recommend you 91 | use the script tag approach. If you are more experienced or want to write larger programs it might be 92 | worthwhile to explore using build tools. 93 |

94 | 95 |

Usage via Script Tag

96 |

Add the following script tag to your main HTML file.

97 | 98 |
99 |
100 |           
101 | <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@{{latestVersion}}/dist/tf.min.js"></script>
102 |           
103 |         
104 |
105 | 106 |
107 | 110 |
111 | 112 |

Installation via NPM

113 | 114 |
115 |
yarn add @tensorflow/tfjs
116 | or     117 |
npm install @tensorflow/tfjs
118 |
119 | 120 |
121 | 124 |
125 | 126 | 127 |
128 | 129 |

Installation for Node.js

130 | 131 | 132 |
133 | Option 1: Install TensorFlow.js with native C++ bindings. 134 |
135 |
yarn add @tensorflow/tfjs-node
136 | or     137 |
npm install @tensorflow/tfjs-node
138 |
139 |
140 | 141 |
142 | Option 2: (Linux Only) If your system has a NVIDIA® GPU with 143 | CUDA 144 | support, use the GPU package even for higher performance. 145 |
146 |
yarn add @tensorflow/tfjs-node-gpu
147 | or     148 |
npm install @tensorflow/tfjs-node-gpu
149 |
150 |
151 | 152 |
153 | Option 3: Install the pure JavaScript version. This will be the slowest option of these 3. 154 |
155 |
yarn add @tensorflow/tfjs
156 | or     157 |
npm install @tensorflow/tfjs
158 |
159 |
160 | 161 |
162 | 165 |
166 | 167 |
168 | 169 |
170 | 171 | 172 | 204 |
205 | -------------------------------------------------------------------------------- /themes/dljs/source/css/api.scss: -------------------------------------------------------------------------------- 1 | $mdc-theme-primary: #0277BD; 2 | // $mdc-theme-secondary: #76ff03; 3 | // $mdc-theme-background: #fff; 4 | 5 | @import "material-components-web/material-components-web"; 6 | 7 | $header-height: 91px; 8 | 9 | $muted-text-col: #616161; 10 | $dark-text-col: #212121; 11 | 12 | $brand-color-dark: #ef6c00; 13 | $brand-color-bright: #F7911F; 14 | 15 | body { 16 | @media (max-width: 720px) { 17 | overflow: scroll; 18 | width: 100vw; 19 | 20 | footer { 21 | display: none; 22 | } 23 | } 24 | } 25 | 26 | .main { 27 | margin: 0 !important; 28 | padding: 0 !important; 29 | } 30 | 31 | .page { 32 | padding: 0 !important; 33 | max-width: none !important; 34 | } 35 | 36 | header { 37 | position: fixed !important; 38 | z-index: 100; 39 | } 40 | 41 | footer { 42 | z-index: 100; 43 | } 44 | 45 | // Fix overlap of header with current target url fragment. 46 | :target::before { 47 | display: block; 48 | content: ""; 49 | margin-top: -128px; 50 | height: 128px; 51 | visibility: hidden; 52 | pointer-events: none; 53 | } 54 | 55 | 56 | .api-docs { 57 | display: flex; 58 | flex-direction: row; 59 | 60 | font-size: 90%; 61 | 62 | // Page layout 63 | .toc { 64 | position: fixed; 65 | height: calc(100vh - (#{$header-height * 2})); 66 | top: calc(#{$header-height}); 67 | width: 300px; 68 | overflow-y: auto; 69 | overflow-x: hidden; 70 | z-index: 101; 71 | 72 | .method-list { 73 | margin-left: 8px; 74 | margin-top: 4px; 75 | font-size: 94%; 76 | } 77 | } 78 | 79 | .reference { 80 | flex-grow: 1; 81 | overflow-y: auto; 82 | overflow-x: hidden; 83 | margin-left: 340px; 84 | margin-top: 64px; 85 | padding-bottom: 75vh 86 | } 87 | 88 | 89 | @media (max-width: 720px) { 90 | flex-direction: column; 91 | 92 | .toc { 93 | display:none; 94 | } 95 | 96 | .reference { 97 | margin: 10px; 98 | overflow-x: hidden; 99 | padding-bottom: 40px; 100 | } 101 | } 102 | 103 | // Styles 104 | 105 | .toc { 106 | // background-color: #fafafa; 107 | padding-left: 16px; 108 | 109 | .symbol { 110 | margin: 8px 0 8px 0px; 111 | } 112 | 113 | .header { 114 | // @include mdc-typography("headline"); 115 | margin-top: 28px; 116 | 117 | .version-string { 118 | font-weight: bold; 119 | font-size: 14px; 120 | } 121 | } 122 | 123 | .heading-name { 124 | margin: 32px 0 4px 0; 125 | font-weight: bold; 126 | text-transform: uppercase; 127 | display: inline-block; 128 | letter-spacing: 1.2px; 129 | border-bottom: 2px solid #0277BD; 130 | width: 200px; 131 | } 132 | 133 | 134 | .subheading { 135 | margin-left: 16px; 136 | } 137 | 138 | .subheading-name { 139 | display: inline-block; 140 | margin: 24px 0 8px 0px; 141 | border-bottom: 1px solid #0277BD; 142 | } 143 | 144 | 145 | a { 146 | font-weight: normal; 147 | text-decoration-color: lightgrey; 148 | text-decoration: none; 149 | transition-property: color, text-decoration-color, margin; 150 | transition-duration: 0.15s; 151 | margin-left: 0; 152 | color: $dark-text-col; 153 | } 154 | 155 | a.highlighted { 156 | color: #0277BD; 157 | text-decoration-color: #002b36; 158 | margin-left: 6px; 159 | font-weight: bold; 160 | } 161 | } 162 | 163 | .reference { 164 | .api-section { 165 | max-width: 780px; 166 | 167 | .heading { 168 | .title { 169 | @include mdc-typography("headline"); 170 | margin-top: 64px; 171 | border-bottom: 4px solid #0277BD; 172 | font-weight: 700; 173 | 174 | a { 175 | text-decoration: none; 176 | } 177 | } 178 | 179 | .description { 180 | font-size: 16px; 181 | } 182 | } 183 | 184 | .subheading { 185 | .title { 186 | @include mdc-typography("headline"); 187 | margin-top: 64px; 188 | 189 | border-bottom: 1px solid #0277BD; 190 | 191 | a { 192 | text-decoration: none; 193 | } 194 | } 195 | 196 | .description { 197 | font-size: 16px; 198 | } 199 | } 200 | } 201 | 202 | .symbol { 203 | margin-top: 64px; 204 | background-color: #fafafa; 205 | padding: 32px; 206 | border-radius: 8px; 207 | 208 | .source-link { 209 | float:right; 210 | text-align: right; 211 | text-transform: lowercase; 212 | font-weight: normal; 213 | font-size: 12px; 214 | padding: 8px; 215 | } 216 | 217 | .symbol-link:focus { 218 | outline-color: transparent; 219 | outline-style: none; 220 | } 221 | 222 | .symbol-marker { 223 | font-size: 12px; 224 | background-color: #f5f5f5; 225 | border-radius: 4px; 226 | padding: 4px 8px 4px 8px; 227 | margin-left: 8px; 228 | font-weight: bold; 229 | color: $muted-text-col; 230 | } 231 | 232 | .symbol-header { 233 | font-size: 20px; 234 | font-weight: 700; 235 | font-family: "Roboto Mono", Roboto; 236 | } 237 | 238 | } 239 | 240 | .parameter-list { 241 | margin-top: 16px; 242 | 243 | .heading { 244 | font-weight: 500; 245 | color: $muted-text-col; 246 | } 247 | 248 | ul { 249 | padding-left:16px; 250 | } 251 | 252 | li.parameter { 253 | list-style-type: none; 254 | margin-bottom: 12px; 255 | line-height: 1.5em; 256 | 257 | &.config-param { 258 | margin-left: 24px; 259 | 260 | .param-name { 261 | color: $dark-text-col; 262 | } 263 | } 264 | 265 | .param-name { 266 | font-family: "Roboto Mono", Roboto; 267 | font-weight: bold; 268 | } 269 | 270 | .param-type { 271 | color: $muted-text-col; 272 | font-family: "Roboto Mono", Roboto; 273 | word-wrap: break-word; 274 | 275 | a { 276 | display: inline-block; 277 | } 278 | } 279 | } 280 | } 281 | 282 | .returns { 283 | margin-top: 16px; 284 | 285 | .returns-header { 286 | font-weight: 500; 287 | color: $muted-text-col; 288 | } 289 | 290 | .return-type { 291 | color: $muted-text-col; 292 | font-family: "Roboto Mono", Roboto; 293 | } 294 | } 295 | 296 | code.hljs { 297 | border-radius: 5px; 298 | padding-left: 16px; 299 | border: none; 300 | font-family: "Roboto Mono", Roboto; 301 | font-size: 13px; 302 | } 303 | 304 | pre.hljs { 305 | padding: 0px; 306 | padding-bottom: 32px; 307 | 308 | 309 | margin: 0; 310 | background: white; 311 | max-width: 720px; 312 | } 313 | 314 | .snippet-console { 315 | margin: -32px 0 24px 0; 316 | min-height: 24px; 317 | position: relative; 318 | max-width: 720px; 319 | } 320 | .snippet-console-log { 321 | border-radius: 5px; 322 | background: #f4f4f4; 323 | padding: 8px 16px; 324 | min-height: 16px; 325 | white-space: pre-wrap; 326 | font-family: "Roboto Mono", monospace; 327 | } 328 | .snippet-run-button { 329 | position: absolute; 330 | right: 4px; 331 | top: 5px; 332 | font-size: 12px; 333 | font-weight: bold; 334 | } 335 | 336 | .snippet-edit-button { 337 | position: absolute; 338 | right: 60px; 339 | top: 5px; 340 | font-size: 12px; 341 | font-weight: bold; 342 | } 343 | 344 | .snippet-error { 345 | background-color: rgba(255, 0,0,0.1); 346 | padding: 10px; 347 | border-radius: 5px; 348 | 349 | .snippet-error-msg { 350 | margin-left: 8px; 351 | } 352 | } 353 | 354 | } 355 | } 356 | -------------------------------------------------------------------------------- /source/tutorials/how-to-get-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: how-to-get-started 3 | date: 2018-09-18 16:28:23 4 | --- 5 | 6 | # How to get started with X: a guide for TensorFlow.js Users 7 | 8 | Doing machine learning with TensorFlow.js requires knowledge of a number of different domains, in particular: machine learning and neural networks, JavaScript, and either Node.JS or browser-based development. Depending on your background you may not be familiar with one or more of these areas. There are lots of great learning resources on the web, and we hope this guide can be a starting point for you in supplementing your knowledge in these areas. 9 | 10 | ## Table of Contents 11 | 12 | - [How to get started with Machine Learning](#ml) 13 | - [TensorFlow.js Focused](#ml-tfjs) 14 | - [Comprehensive Resources](#ml-comprehensive) 15 | - [Math Concepts](#ml-math) 16 | - [Other Tools](#ml-other) 17 | - [How to get started with JavaScript (the programming language)](#js) 18 | - [How to get started with Browser Based Development](#browser) 19 | - [How to get started with Node.JS Development](#node) 20 | - [How to get started with Contributing to TensorFlow.js](#contrib) 21 | - [Contributing to source code](#contrib-source) 22 | - [Creating learning resources and blog posts](#contrib-learning) 23 | 24 | ## How to get started with Machine Learning 25 | 26 | TensorFlow.js is a tool that provides building blocks for building deep neural networks. However the fields of machine learning (ML) and deep learning (DL) are vast. If you want to write your own models or tweak existing ones, it is useful to gain a working knowledge of core concepts and techniques from the field of machine learning. 27 | 28 | A great high level introduction to neural networks to get started with is Neural Networks by 3blue1brown. 29 | 30 | ### TensorFlow.js Focused 31 | 32 | These resources focus on TensorFlow.js and are also focused on beginners to machine learning. 33 | 34 | - [TensorFlow.js: Intelligence and Learning Series](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YIeVA3dNxbR9PYj4wV31oQ) by Coding Train [Video] 35 | - [TensorFlow.js: Color Classifier](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bmMRCIoTi72aNWHo7epX4L) by Coding Train [Video] 36 | - [TensorFlow.js Deep Learning with JavaScript](https://www.youtube.com/playlist?list=PLZbbT5o_s2xr83l8w44N_g3pygvajLrJ-) by Deeplizard [Video] 37 | 38 | ### Comprehensive Resources 39 | 40 | These are fairly comprehensive online courses that cover a large amount of machine learning and deep learning material. However the reality is that at this point in time most courses use Python as the primary language of instruction. However the concepts do translate to using TensorFlow.js even if the syntax doesn’t. 41 | 42 | - [Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course/ml-intro) by Google [Video] [Online coding exercises (Python)] 43 | - [Deep Learning Specialization](https://www.coursera.org/specializations/deep-learning) by Coursera [Video] 44 | - [Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com/) by Michael Nielsen [Online Book] 45 | - [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python) by Francois Chollet [Book] 46 | - [CS231n: Convolutional Neural Networks for Visual Recognition](http://cs231n.stanford.edu/) by Stanford [Video] [Slides] 47 | - [Hands-on Machine Learning with Scikit-Learn and TensorFlow](http://shop.oreilly.com/product/0636920052289.do) by Aurélien Géron [Book] 48 | 49 | ### Math Concepts 50 | 51 | Machine Learning is a math heavy discipline, and while it is not necessary to understand the math if you are just using machine learning models, if you plan to modify machine learning models or build new ones from scratch, familiarity with the underlying math concepts can be helpful. 52 | 53 | - [Essence of Calculus](https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53DwVRMYO3t5Yr) by 3blue1brown [Video] 54 | - [Essence of Linear Algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) by 3blue1brown [Video] 55 | - [Linear Algebra](https://www.khanacademy.org/math/linear-algebra) by Khan Academy [Video] 56 | - [Calculus](https://www.khanacademy.org/math/calculus-home) by Khan Academy [Video] 57 | 58 | ### Other Tools 59 | 60 | If you are just getting started and find TensorFlow.js a bit overwhelming but still want to experiment with machine learning in the browser, you may be interested in checking out the following resources: 61 | 62 | - [ML5](https://ml5js.org/) is a library built on top of TensorFlow.js that provides a higher level API to machine learning algorithms in the browser. 63 | - [tfjs-models](https://github.com/tensorflow/tfjs-models) is a small but growing collection of pre-trained models with straightforward APIs to perform various tasks. These allow you to treat the machine learning aspect completely as a black box. 64 | 65 | ## How to get started with JavaScript (the programming language) 66 | 67 | If you are new to Javascript, these resources are good places to start if you need an overview or tutorial on the language itself. 68 | 69 | - [Mozilla JavaScript Guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript) by Mozilla [Website] 70 | - [Eloquent JavaScript](http://eloquentjavascript.net/) by Marijn Haverbeke [Online Book] 71 | - [The Modern JavaScript Tutorial](https://javascript.info/) by Ilya Kantor [Website] 72 | 73 | ## How to get started with Browser Based Development 74 | 75 | If you are using TensorFlow.js in the browser it will be helpful to know a few things about browser development and the DOM. 76 | 77 | - [Getting started with Web Development](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web) by Mozilla [Website] 78 | - [Modern Javascript Developers for Dinosaurs](https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70) by Peter Jang: 79 | This introduces some of the tooling used in modern web development workflows, such as package managers like npm and yarn and transpilers like babel. [Blog post] 80 | 81 | ## How to get started with Node.JS Development 82 | 83 | If you are using Tensorflow.js in Node.js, these resources introduce concepts more related to server side programming. You should already be familiar with JavaScript as a language. 84 | 85 | - [Node.js Guides](https://nodejs.org/en/docs/guides/) by Node.js [Website] 86 | - [Mixu’s Node Book](http://book.mixu.net/node/single.html) by Mixu [Online book] 87 | 88 | ## How to get started with Contributing to TensorFlow.js 89 | 90 | There are lots of different ways to contribute to TensorFlow.js. The first thing to think of is what kind of contribution are you interested in making: 91 | 92 | ### Contributing to source code 93 | 94 | Source code contributions don’t have to be complex. Improvements to documentation, error messages and tests are very welcome and require varying levels of knowledge of how the library works. One thing common to all contributions is learning how GitHub works as that is how we manage TensorFlow.js projects. If you want to make code contributions, familiarity with TypeScript will be necessary. 95 | 96 | - [GitHub Hello World](https://guides.github.com/activities/hello-world/) by GitHub 97 | - [Github Intro to Forking Projects](https://guides.github.com/activities/forking/) by GitHub 98 | - [TensorFlow.js Contributors Guide](https://github.com/tensorflow/tfjs/blob/master/CONTRIBUTING.md) by the TensorFlow.js team 99 | - [TypeScript Documentation](https://www.typescriptlang.org/docs/home.html) by Microsoft 100 | 101 | ### Creating learning resources and blog posts 102 | 103 | Another great contribution is learning resources like blog posts and open source examples that others can read and learn from. If you have made something you think others might find useful, feel free to share it on the [TensorFlow.js Community Mailing List](https://groups.google.com/a/tensorflow.org/forum/#!forum/tfjs). We also maintain a [list of community projects here](https://github.com/tensorflow/tfjs/blob/master/GALLERY.md). 104 | -------------------------------------------------------------------------------- /source/_data/api/0.12.5/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": [ 5 | "

Tensors are the core datastructure of TensorFlow.js", 6 | "They are a generalization of vectors and matrices to potentially", 7 | "higher dimensions.

" 8 | ], 9 | "subheadings": [ 10 | { 11 | "name": "Creation", 12 | "description": [ 13 | "

We have utility functions for common cases like Scalar, 1D,", 14 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 15 | "tensors in ways useful for machine learning.

" 16 | ], 17 | "pin": [ 18 | "tensor", 19 | "scalar", 20 | "tensor1d", 21 | "tensor2d", 22 | "tensor3d", 23 | "tensor4d", 24 | "tensor5d", 25 | "tensor6d" 26 | ] 27 | }, 28 | { 29 | "name": "Classes", 30 | "description": [ 31 | "

", 32 | "This section shows the main Tensor related classes in TensorFlow.js and", 33 | "the methods we expose on them.", 34 | "

" 35 | ], 36 | "pin": [ 37 | "Tensor", 38 | "Variable", 39 | "TensorBuffer" 40 | ] 41 | }, 42 | { 43 | "name": "Transformations", 44 | "description": [ 45 | "

This section describes some common Tensor", 46 | "transformations for reshaping and type-casting.

" 47 | ] 48 | }, 49 | { 50 | "name": "Slicing and Joining", 51 | "description": [ 52 | "

TensorFlow.js provides several operations", 53 | "to slice or extract parts of a tensor, or join multiple", 54 | "tensors together." 55 | ] 56 | } 57 | ] 58 | }, 59 | { 60 | "name": "Models", 61 | "description": [ 62 | "

Models are one of the primary abstractions used in", 63 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 64 | "for prediction. A model's state (topology, and optionally, trained", 65 | "weights) can be restored from various formats.

", 66 | "

Models are a collection of Layers, see Model Creation for", 67 | "details about how Layers can be connected.

" 68 | ], 69 | "subheadings": [ 70 | { 71 | "name": "Creation", 72 | "description": [ 73 | "

There are two primary ways of creating models.

", 74 | "" 80 | ], 81 | "pin": [ 82 | "sequential", 83 | "model" 84 | ] 85 | }, 86 | { 87 | "name": "Inputs", 88 | "description": [] 89 | }, 90 | { 91 | "name": "Loading", 92 | "description": [] 93 | } 94 | ] 95 | }, 96 | { 97 | "name": "Layers", 98 | "description": [ 99 | "

Layers are the primary building block for ", 100 | "constructing a Model. Each layer will typically perform some", 101 | "computation to transform its input to its output.

", 102 | "

Layers will automatically take care of creating and initializing", 103 | "the various internal variables/weights they need to function.

" 104 | ], 105 | "subheadings": [ 106 | { 107 | "name": "Advanced Activation", 108 | "description": [] 109 | }, 110 | { 111 | "name": "Basic", 112 | "description": [] 113 | }, 114 | { 115 | "name": "Convolutional", 116 | "description": [] 117 | }, 118 | { 119 | "name": "Merge", 120 | "description": [] 121 | }, 122 | { 123 | "name": "Normalization", 124 | "description": [] 125 | }, 126 | { 127 | "name": "Pooling", 128 | "description": [] 129 | }, 130 | { 131 | "name": "Recurrent", 132 | "description": [] 133 | }, 134 | { 135 | "name": "Wrapper", 136 | "description": [] 137 | } 138 | ] 139 | }, 140 | { 141 | "name": "Operations", 142 | "description": [], 143 | "subheadings": [ 144 | { 145 | "name": "Arithmetic", 146 | "description": [ 147 | "

To perform mathematical computation on Tensors, we use", 148 | "operations. Tensors are immutable, so all operations always return", 149 | "new Tensors and never modify input Tensors.

" 150 | ], 151 | "pin": [ 152 | "add", 153 | "sub", 154 | "mul", 155 | "div" 156 | ] 157 | }, 158 | { 159 | "name": "Basic math" 160 | }, 161 | { 162 | "name": "Matrices" 163 | }, 164 | { 165 | "name": "Convolution" 166 | }, 167 | { 168 | "name": "Reduction" 169 | }, 170 | { 171 | "name": "Normalization" 172 | }, 173 | { 174 | "name": "Images" 175 | }, 176 | { 177 | "name": "RNN" 178 | }, 179 | { 180 | "name": "Logical" 181 | } 182 | ] 183 | }, 184 | { 185 | "name": "Training", 186 | "description": [ 187 | "

We also provide an API to do perform training, and", 188 | "compute gradients. We compute gradients eagerly, users provide a function", 189 | "that is a combination of operations and we automatically differentiate", 190 | "that function's output with respect to its inputs.", 191 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 192 | "the TensorFlow Eager API.", 193 | "

" 194 | ], 195 | "subheadings": [ 196 | { 197 | "name": "Gradients", 198 | "pin": [ 199 | "grad", 200 | "grads", 201 | "valAndGrad", 202 | "valAndGrads", 203 | "customGrad" 204 | ] 205 | }, 206 | { 207 | "name": "Optimizers", 208 | "pin": [ 209 | "sgd", 210 | "momentum", 211 | "adagrad", 212 | "adadelta" 213 | ] 214 | }, 215 | { 216 | "name": "Losses" 217 | }, 218 | { 219 | "name": "Classes" 220 | } 221 | ] 222 | }, 223 | { 224 | "name": "Performance", 225 | "description": [], 226 | "subheadings": [ 227 | { 228 | "name": "Memory", 229 | "pin": [ 230 | "tidy" 231 | ] 232 | }, 233 | { 234 | "name": "Timing", 235 | "pin": [ 236 | "time" 237 | ] 238 | } 239 | ] 240 | }, 241 | { 242 | "name": "Environment", 243 | "description": [ 244 | "

TensorFlow.js can run mathematical operations on", 245 | "different backends. Currently, we support WebGL and JavaScript", 246 | "CPU. By default, we choose the 'best' backend available, but", 247 | "allow users to customize their backend.

" 248 | ], 249 | "subheadings": [] 250 | }, 251 | { 252 | "name": "Constraints", 253 | "description": [ 254 | "

Constraints are added to attributes", 255 | "of a Layer (such as weights, kernels, or biases) at", 256 | "construction time to clamp, or otherwise enforce an allowed range,", 257 | "of values for different components of the Layer.

" 258 | ], 259 | "subheadings": [] 260 | }, 261 | { 262 | "name": "Initializers", 263 | "description": [ 264 | "

Initializers are used in Layers", 265 | "to establish the starting the values of weights, biases, kernels, ", 266 | "etc.

" 267 | ], 268 | "subheadings": [] 269 | }, 270 | { 271 | "name": "Regularizers", 272 | "description": [ 273 | "

Regularizers can be attached to various components", 274 | "of a Layer to add a 'scoring' function to help drive weights, or ", 275 | "other trainable values, away from excessively large values. They're", 276 | "typically used to promote a notion that a 'simpler' model is better", 277 | "than a complicated model, assuming equal performance.

" 278 | ], 279 | "subheadings": [] 280 | } 281 | ] 282 | -------------------------------------------------------------------------------- /source/_data/api/0.13.0/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": [ 5 | "

Tensors are the core datastructure of TensorFlow.js", 6 | "They are a generalization of vectors and matrices to potentially", 7 | "higher dimensions.

" 8 | ], 9 | "subheadings": [ 10 | { 11 | "name": "Creation", 12 | "description": [ 13 | "

We have utility functions for common cases like Scalar, 1D,", 14 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 15 | "tensors in ways useful for machine learning.

" 16 | ], 17 | "pin": [ 18 | "tensor", 19 | "scalar", 20 | "tensor1d", 21 | "tensor2d", 22 | "tensor3d", 23 | "tensor4d", 24 | "tensor5d", 25 | "tensor6d" 26 | ] 27 | }, 28 | { 29 | "name": "Classes", 30 | "description": [ 31 | "

", 32 | "This section shows the main Tensor related classes in TensorFlow.js and", 33 | "the methods we expose on them.", 34 | "

" 35 | ], 36 | "pin": [ 37 | "Tensor", 38 | "Variable", 39 | "TensorBuffer" 40 | ] 41 | }, 42 | { 43 | "name": "Transformations", 44 | "description": [ 45 | "

This section describes some common Tensor", 46 | "transformations for reshaping and type-casting.

" 47 | ] 48 | }, 49 | { 50 | "name": "Slicing and Joining", 51 | "description": [ 52 | "

TensorFlow.js provides several operations", 53 | "to slice or extract parts of a tensor, or join multiple", 54 | "tensors together." 55 | ] 56 | } 57 | ] 58 | }, 59 | { 60 | "name": "Models", 61 | "description": [ 62 | "

Models are one of the primary abstractions used in", 63 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 64 | "for prediction. A model's state (topology, and optionally, trained", 65 | "weights) can be restored from various formats.

", 66 | "

Models are a collection of Layers, see Model Creation for", 67 | "details about how Layers can be connected.

" 68 | ], 69 | "subheadings": [ 70 | { 71 | "name": "Creation", 72 | "description": [ 73 | "

There are two primary ways of creating models.

", 74 | "" 80 | ], 81 | "pin": [ 82 | "sequential", 83 | "model" 84 | ] 85 | }, 86 | { 87 | "name": "Inputs", 88 | "description": [] 89 | }, 90 | { 91 | "name": "Loading", 92 | "description": [] 93 | } 94 | ] 95 | }, 96 | { 97 | "name": "Layers", 98 | "description": [ 99 | "

Layers are the primary building block for ", 100 | "constructing a Model. Each layer will typically perform some", 101 | "computation to transform its input to its output.

", 102 | "

Layers will automatically take care of creating and initializing", 103 | "the various internal variables/weights they need to function.

" 104 | ], 105 | "subheadings": [ 106 | { 107 | "name": "Advanced Activation", 108 | "description": [] 109 | }, 110 | { 111 | "name": "Basic", 112 | "description": [] 113 | }, 114 | { 115 | "name": "Convolutional", 116 | "description": [] 117 | }, 118 | { 119 | "name": "Merge", 120 | "description": [] 121 | }, 122 | { 123 | "name": "Normalization", 124 | "description": [] 125 | }, 126 | { 127 | "name": "Pooling", 128 | "description": [] 129 | }, 130 | { 131 | "name": "Recurrent", 132 | "description": [] 133 | }, 134 | { 135 | "name": "Wrapper", 136 | "description": [] 137 | } 138 | ] 139 | }, 140 | { 141 | "name": "Operations", 142 | "description": [], 143 | "subheadings": [ 144 | { 145 | "name": "Arithmetic", 146 | "description": [ 147 | "

To perform mathematical computation on Tensors, we use", 148 | "operations. Tensors are immutable, so all operations always return", 149 | "new Tensors and never modify input Tensors.

" 150 | ], 151 | "pin": [ 152 | "add", 153 | "sub", 154 | "mul", 155 | "div" 156 | ] 157 | }, 158 | { 159 | "name": "Basic math" 160 | }, 161 | { 162 | "name": "Matrices" 163 | }, 164 | { 165 | "name": "Convolution" 166 | }, 167 | { 168 | "name": "Reduction" 169 | }, 170 | { 171 | "name": "Normalization" 172 | }, 173 | { 174 | "name": "Images" 175 | }, 176 | { 177 | "name": "RNN" 178 | }, 179 | { 180 | "name": "Logical" 181 | } 182 | ] 183 | }, 184 | { 185 | "name": "Training", 186 | "description": [ 187 | "

We also provide an API to do perform training, and", 188 | "compute gradients. We compute gradients eagerly, users provide a function", 189 | "that is a combination of operations and we automatically differentiate", 190 | "that function's output with respect to its inputs.", 191 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 192 | "the TensorFlow Eager API.", 193 | "

" 194 | ], 195 | "subheadings": [ 196 | { 197 | "name": "Gradients", 198 | "pin": [ 199 | "grad", 200 | "grads", 201 | "valAndGrad", 202 | "valAndGrads", 203 | "customGrad" 204 | ] 205 | }, 206 | { 207 | "name": "Optimizers", 208 | "pin": [ 209 | "sgd", 210 | "momentum", 211 | "adagrad", 212 | "adadelta" 213 | ] 214 | }, 215 | { 216 | "name": "Losses" 217 | }, 218 | { 219 | "name": "Classes" 220 | } 221 | ] 222 | }, 223 | { 224 | "name": "Performance", 225 | "description": [], 226 | "subheadings": [ 227 | { 228 | "name": "Memory", 229 | "pin": [ 230 | "tidy" 231 | ] 232 | }, 233 | { 234 | "name": "Timing", 235 | "pin": [ 236 | "time" 237 | ] 238 | } 239 | ] 240 | }, 241 | { 242 | "name": "Environment", 243 | "description": [ 244 | "

TensorFlow.js can run mathematical operations on", 245 | "different backends. Currently, we support WebGL and JavaScript", 246 | "CPU. By default, we choose the 'best' backend available, but", 247 | "allow users to customize their backend.

" 248 | ], 249 | "subheadings": [] 250 | }, 251 | { 252 | "name": "Constraints", 253 | "description": [ 254 | "

Constraints are added to attributes", 255 | "of a Layer (such as weights, kernels, or biases) at", 256 | "construction time to clamp, or otherwise enforce an allowed range,", 257 | "of values for different components of the Layer.

" 258 | ], 259 | "subheadings": [] 260 | }, 261 | { 262 | "name": "Initializers", 263 | "description": [ 264 | "

Initializers are used in Layers", 265 | "to establish the starting the values of weights, biases, kernels, ", 266 | "etc.

" 267 | ], 268 | "subheadings": [] 269 | }, 270 | { 271 | "name": "Regularizers", 272 | "description": [ 273 | "

Regularizers can be attached to various components", 274 | "of a Layer to add a 'scoring' function to help drive weights, or ", 275 | "other trainable values, away from excessively large values. They're", 276 | "typically used to promote a notion that a 'simpler' model is better", 277 | "than a complicated model, assuming equal performance.

" 278 | ], 279 | "subheadings": [] 280 | } 281 | ] 282 | -------------------------------------------------------------------------------- /source/_data/api/0.13.3/skeleton.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Tensors", 4 | "description": [ 5 | "

Tensors are the core datastructure of TensorFlow.js", 6 | "They are a generalization of vectors and matrices to potentially", 7 | "higher dimensions.

" 8 | ], 9 | "subheadings": [ 10 | { 11 | "name": "Creation", 12 | "description": [ 13 | "

We have utility functions for common cases like Scalar, 1D,", 14 | "2D, 3D and 4D tensors, as well a number of functions to initialize", 15 | "tensors in ways useful for machine learning.

" 16 | ], 17 | "pin": [ 18 | "tensor", 19 | "scalar", 20 | "tensor1d", 21 | "tensor2d", 22 | "tensor3d", 23 | "tensor4d", 24 | "tensor5d", 25 | "tensor6d" 26 | ] 27 | }, 28 | { 29 | "name": "Classes", 30 | "description": [ 31 | "

", 32 | "This section shows the main Tensor related classes in TensorFlow.js and", 33 | "the methods we expose on them.", 34 | "

" 35 | ], 36 | "pin": [ 37 | "Tensor", 38 | "Variable", 39 | "TensorBuffer" 40 | ] 41 | }, 42 | { 43 | "name": "Transformations", 44 | "description": [ 45 | "

This section describes some common Tensor", 46 | "transformations for reshaping and type-casting.

" 47 | ] 48 | }, 49 | { 50 | "name": "Slicing and Joining", 51 | "description": [ 52 | "

TensorFlow.js provides several operations", 53 | "to slice or extract parts of a tensor, or join multiple", 54 | "tensors together." 55 | ] 56 | } 57 | ] 58 | }, 59 | { 60 | "name": "Models", 61 | "description": [ 62 | "

Models are one of the primary abstractions used in", 63 | "TensorFlow.js Layers. Models can be trained, evaluated, and used", 64 | "for prediction. A model's state (topology, and optionally, trained", 65 | "weights) can be restored from various formats.

", 66 | "

Models are a collection of Layers, see Model Creation for", 67 | "details about how Layers can be connected.

" 68 | ], 69 | "subheadings": [ 70 | { 71 | "name": "Creation", 72 | "description": [ 73 | "

There are two primary ways of creating models.

", 74 | "" 80 | ], 81 | "pin": [ 82 | "sequential", 83 | "model" 84 | ] 85 | }, 86 | { 87 | "name": "Inputs", 88 | "description": [] 89 | }, 90 | { 91 | "name": "Loading", 92 | "description": [] 93 | } 94 | ] 95 | }, 96 | { 97 | "name": "Layers", 98 | "description": [ 99 | "

Layers are the primary building block for ", 100 | "constructing a Model. Each layer will typically perform some", 101 | "computation to transform its input to its output.

", 102 | "

Layers will automatically take care of creating and initializing", 103 | "the various internal variables/weights they need to function.

" 104 | ], 105 | "subheadings": [ 106 | { 107 | "name": "Advanced Activation", 108 | "description": [] 109 | }, 110 | { 111 | "name": "Basic", 112 | "description": [] 113 | }, 114 | { 115 | "name": "Convolutional", 116 | "description": [] 117 | }, 118 | { 119 | "name": "Merge", 120 | "description": [] 121 | }, 122 | { 123 | "name": "Normalization", 124 | "description": [] 125 | }, 126 | { 127 | "name": "Pooling", 128 | "description": [] 129 | }, 130 | { 131 | "name": "Recurrent", 132 | "description": [] 133 | }, 134 | { 135 | "name": "Wrapper", 136 | "description": [] 137 | } 138 | ] 139 | }, 140 | { 141 | "name": "Operations", 142 | "description": [], 143 | "subheadings": [ 144 | { 145 | "name": "Arithmetic", 146 | "description": [ 147 | "

To perform mathematical computation on Tensors, we use", 148 | "operations. Tensors are immutable, so all operations always return", 149 | "new Tensors and never modify input Tensors.

" 150 | ], 151 | "pin": [ 152 | "add", 153 | "sub", 154 | "mul", 155 | "div" 156 | ] 157 | }, 158 | { 159 | "name": "Basic math" 160 | }, 161 | { 162 | "name": "Matrices" 163 | }, 164 | { 165 | "name": "Convolution" 166 | }, 167 | { 168 | "name": "Reduction" 169 | }, 170 | { 171 | "name": "Normalization" 172 | }, 173 | { 174 | "name": "Images" 175 | }, 176 | { 177 | "name": "RNN" 178 | }, 179 | { 180 | "name": "Logical" 181 | } 182 | ] 183 | }, 184 | { 185 | "name": "Training", 186 | "description": [ 187 | "

We also provide an API to do perform training, and", 188 | "compute gradients. We compute gradients eagerly, users provide a function", 189 | "that is a combination of operations and we automatically differentiate", 190 | "that function's output with respect to its inputs.", 191 | "

For those familiar with TensorFlow, the API we expose exactly mirrors", 192 | "the TensorFlow Eager API.", 193 | "

" 194 | ], 195 | "subheadings": [ 196 | { 197 | "name": "Gradients", 198 | "pin": [ 199 | "grad", 200 | "grads", 201 | "valAndGrad", 202 | "valAndGrads", 203 | "customGrad" 204 | ] 205 | }, 206 | { 207 | "name": "Optimizers", 208 | "pin": [ 209 | "sgd", 210 | "momentum", 211 | "adagrad", 212 | "adadelta" 213 | ] 214 | }, 215 | { 216 | "name": "Losses" 217 | }, 218 | { 219 | "name": "Classes" 220 | } 221 | ] 222 | }, 223 | { 224 | "name": "Performance", 225 | "description": [], 226 | "subheadings": [ 227 | { 228 | "name": "Memory", 229 | "pin": [ 230 | "tidy" 231 | ] 232 | }, 233 | { 234 | "name": "Timing", 235 | "pin": [ 236 | "time" 237 | ] 238 | } 239 | ] 240 | }, 241 | { 242 | "name": "Environment", 243 | "description": [ 244 | "

TensorFlow.js can run mathematical operations on", 245 | "different backends. Currently, we support WebGL and JavaScript", 246 | "CPU. By default, we choose the 'best' backend available, but", 247 | "allow users to customize their backend.

" 248 | ], 249 | "subheadings": [] 250 | }, 251 | { 252 | "name": "Constraints", 253 | "description": [ 254 | "

Constraints are added to attributes", 255 | "of a Layer (such as weights, kernels, or biases) at", 256 | "construction time to clamp, or otherwise enforce an allowed range,", 257 | "of values for different components of the Layer.

" 258 | ], 259 | "subheadings": [] 260 | }, 261 | { 262 | "name": "Initializers", 263 | "description": [ 264 | "

Initializers are used in Layers", 265 | "to establish the starting the values of weights, biases, kernels, ", 266 | "etc.

" 267 | ], 268 | "subheadings": [] 269 | }, 270 | { 271 | "name": "Regularizers", 272 | "description": [ 273 | "

Regularizers can be attached to various components", 274 | "of a Layer to add a 'scoring' function to help drive weights, or ", 275 | "other trainable values, away from excessively large values. They're", 276 | "typically used to promote a notion that a 'simpler' model is better", 277 | "than a complicated model, assuming equal performance.

" 278 | ], 279 | "subheadings": [] 280 | } 281 | ] 282 | --------------------------------------------------------------------------------