├── .DS_Store
├── .coveralls.yml
├── .esdoc.json
├── .eslintrc
├── .eslintrc.json
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bundle
├── tensorscript.cjs.js
├── tensorscript.esm.js
├── tensorscript.umd.js
├── tensorscript.umd.min.js
├── tensorscript.web.js
└── tensorscript.web.min.js
├── docs
├── API.md
├── CNAME
├── ast
│ └── source
│ │ ├── classification.mjs.json
│ │ ├── deep_learning.mjs.json
│ │ ├── deeplearning.mjs.json
│ │ ├── logistic_regression.mjs.json
│ │ ├── lstm_multivariate_time_series.mjs.json
│ │ ├── lstm_time_series.mjs.json
│ │ ├── mlr.mjs.json
│ │ ├── model_interface.mjs.json
│ │ ├── multiple_linear_regression.mjs.json
│ │ └── regression.mjs.json
├── badge.svg
├── class
│ └── lib
│ │ ├── classification.mjs~DeepLearningClassification.html
│ │ ├── deep_learning.mjs~BaseNeuralNetwork.html
│ │ ├── deeplearning.mjs~BaseNeuralNetwork.html
│ │ ├── deeplearning.mjs~DeepLearningClassification.html
│ │ ├── deeplearning.mjs~DeepLearningRegression.html
│ │ ├── logistic_regression.mjs~LogisticRegression.html
│ │ ├── lstm_multivariate_time_series.mjs~LSTMMultivariateTimeSeries.html
│ │ ├── lstm_time_series.mjs~LSTMTimeSeries.html
│ │ ├── mlr.mjs~MultipleLinearRegression.html
│ │ ├── model_interface.mjs~TensorScriptModelInterface.html
│ │ ├── multiple_linear_regression.mjs~MultipleLinearRegression.html
│ │ └── regression.mjs~DeepLearningRegression.html
├── coverage.json
├── css
│ ├── github.css
│ ├── identifiers.css
│ ├── manual.css
│ ├── prettify-tomorrow.css
│ ├── search.css
│ ├── source.css
│ ├── style.css
│ └── test.css
├── file
│ └── lib
│ │ ├── classification.mjs.html
│ │ ├── deep_learning.mjs.html
│ │ ├── deeplearning.mjs.html
│ │ ├── logistic_regression.mjs.html
│ │ ├── lstm_multivariate_time_series.mjs.html
│ │ ├── lstm_time_series.mjs.html
│ │ ├── mlr.mjs.html
│ │ ├── model_interface.mjs.html
│ │ ├── multiple_linear_regression.mjs.html
│ │ └── regression.mjs.html
├── gtm.js
├── identifiers.html
├── image
│ ├── badge.svg
│ ├── esdoc-logo-mini-black.png
│ ├── esdoc-logo-mini.png
│ ├── github.png
│ ├── manual-badge.svg
│ └── search.png
├── index.html
├── index.json
├── manual
│ ├── CHANGELOG.html
│ ├── configuration.html
│ ├── example.html
│ ├── faq.html
│ ├── index.html
│ ├── installation.html
│ ├── overview.html
│ ├── tutorial.html
│ └── usage.html
├── script
│ ├── inherited-summary.js
│ ├── inner-link.js
│ ├── manual.js
│ ├── patch-for-local.js
│ ├── prettify
│ │ ├── Apache-License-2.0.txt
│ │ └── prettify.js
│ ├── pretty-print.js
│ ├── search.js
│ ├── search_index.js
│ └── test-summary.js
├── source.html
├── test-file
│ └── test
│ │ └── unit
│ │ ├── base_neural_network_spec.mjs.html
│ │ ├── classification_spec.mjs.html
│ │ ├── logistic_regression_spec.mjs.html
│ │ ├── lstm_multivariate_time_series_spec.mjs.html
│ │ ├── lstm_time_series_spec.mjs.html
│ │ ├── math_js_spec.mjs.html
│ │ ├── model_interface_spec.mjs.html
│ │ ├── multiple_linear_regression_spec.mjs.html
│ │ └── regression_spec.mjs.html
└── test.html
├── index.js
├── lib
├── classification.js
├── deep_learning.js
├── logistic_regression.js
├── lstm_multivariate_time_series.js
├── lstm_time_series.js
├── model_interface.js
├── multiple_linear_regression.js
├── regression.js
└── text_embedding.js
├── manual
├── examples
│ ├── ex_classification-iris.mjs
│ ├── ex_classification-social.mjs
│ ├── ex_nn-portland.mjs
│ ├── ex_regression-boston.mjs
│ ├── ex_regression-portland.mjs
│ └── ex_timeseries-airline.mjs
├── faq.md
├── overview.md
└── usage.md
├── package.json
├── renovate.json
├── rollup.config.js
└── test
├── .DS_Store
├── mock
├── .DS_Store
└── data
│ ├── .DS_Store
│ ├── airline-sales.csv
│ ├── boston_housing_data.csv
│ ├── boston_housing_names.txt
│ ├── demo.mjs
│ ├── international-airline-passengers-no_footer.csv
│ ├── iris_data.csv
│ ├── iris_names.txt
│ ├── pollution.csv
│ ├── portland_housing_data.csv
│ ├── sample.csv
│ └── social_network_ads.csv
├── mock_saved_files
├── .DS_Store
└── mlr_model
│ ├── model.json
│ └── weights.bin
└── unit
├── base_neural_network_spec.js
├── classification_spec.js
├── logistic_regression_spec.js
├── lstm_multivariate_time_series_spec.js
├── lstm_time_series_spec.js
├── math_js_spec.js
├── model_interface_spec.js
├── multiple_linear_regression_spec.js
├── regression_spec.js
└── text_embedding_spec.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/repetere/tensorscript/8ec5126a3b27d938c77158145f9bce47ffdb108d/.DS_Store
--------------------------------------------------------------------------------
/.coveralls.yml:
--------------------------------------------------------------------------------
1 | service_name: travis-pro
2 | repo_token: W7pCj4DTvWJmrm3Hz0YKcrNSOH00Bq3Hd
--------------------------------------------------------------------------------
/.esdoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "source": "./lib",
3 | "destination": "./docs",
4 | "plugins": [
5 | {
6 | "name": "@repetere/esdoc-inject-gtm-plugin",
7 | "option": {
8 | "enable": true,
9 | "id": "UA-112697260-2"
10 | }
11 | },
12 | {
13 | "name": "esdoc-ecmascript-proposal-plugin",
14 | "option": {"all": true}
15 | },
16 | {
17 | "name": "esdoc-standard-plugin",
18 | "option":{
19 | "typeInference": {
20 | "enable": false
21 | },
22 | "lint": {
23 | "enable": false
24 | },
25 | "brand": {
26 | "title": "TensorScript",
27 | "description": "Deep Learning Classification, Clustering, Time Series, Regression and Multi-Layered Perceptrons with Tensorflow",
28 | "repository": "https://github.com/repetere/tensorscript",
29 | "site": "https://repetere.github.io/tensorscript",
30 | "author": "https://github.com/repetere",
31 | "image": "https://repetere.ai/favicon.png"
32 | },
33 | "manual": {
34 | "index": "./README.md",
35 | "asset": "./manual/asset",
36 | "files": [
37 | "./manual/overview.md",
38 | "./manual/usage.md",
39 | "./manual/faq.md",
40 | "./CHANGELOG.md"
41 | ]
42 | },
43 | "test": {
44 | "source": "./test/",
45 | "interfaces": ["describe", "it", "context", "suite", "test"],
46 | "includes": ["(spec|Spec|test|Test)\\.mjs$"],
47 | "excludes": ["\\.config\\.js$"]
48 | }
49 | }
50 | },
51 | {
52 | "name": "esdoc-publish-markdown-plugin",
53 | "option": {
54 | "filename":"./API.md"
55 | }
56 | }
57 | ],
58 | "includes": ["\\.mjs$"]
59 | }
60 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "eslint:recommended",
3 | "plugins": [],
4 | "parserOptions": {
5 | "sourceType": "module",
6 | "ecmaVersion": 2017,
7 | "ecmaFeatures": {
8 | "jsx": true
9 | }
10 | },
11 | "rules": {
12 | "jsx-quotes": ["error", "prefer-double"],
13 | "indent": ["error", 2],
14 | "quotes": ["error", "single"],
15 | "semi": ["warn", "always"],
16 | "comma-dangle": ["warn", "always"],
17 | "comma-spacing": "warn",
18 | "array-bracket-spacing": "warn",
19 | "object-curly-spacing": ["error", "always"],
20 | "eqeqeq": "warn",
21 | "no-cond-assign": ["warn", "always"],
22 | "no-unused-vars": "warn",
23 | "no-console": "warn",
24 | "brace-style": ["warn", "1tbs"],
25 | "strict": ["error", "safe"]
26 | },
27 | "env": {
28 | "browser": true,
29 | "commonjs": true,
30 | "es6": true,
31 | "node": true,
32 | "mocha": true
33 | }
34 | }
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "eslint:recommended",
3 | "plugins": [],
4 | "parserOptions": {
5 | "sourceType": "module",
6 | "ecmaVersion": 2017,
7 | "ecmaFeatures": {
8 | "jsx": true
9 | }
10 | },
11 | "rules": {
12 | "jsx-quotes": ["error", "prefer-double"],
13 | "indent": ["error", 2],
14 | "quotes": ["error", "single"],
15 | "semi": ["warn", "always"],
16 | "comma-dangle": ["warn", "always"],
17 | "comma-spacing": "warn",
18 | "array-bracket-spacing": "warn",
19 | "object-curly-spacing": ["error", "always"],
20 | "eqeqeq": "warn",
21 | "no-cond-assign": ["warn", "always"],
22 | "no-unused-vars": "warn",
23 | "no-console": "warn",
24 | "brace-style": ["warn", "1tbs"],
25 | "strict": ["error", "safe"]
26 | },
27 | "env": {
28 | "browser": true,
29 | "commonjs": true,
30 | "es6": true,
31 | "node": true,
32 | "mocha": true
33 | }
34 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | .vscode
3 | .vscode/*
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 | package-lock.json
10 | *.package-lock.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 |
24 | # nyc test coverage
25 | .nyc_output
26 |
27 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28 | .grunt
29 |
30 | # Bower dependency directory (https://bower.io/)
31 | bower_components
32 |
33 | # node-waf configuration
34 | .lock-wscript
35 |
36 | # Compiled binary addons (https://nodejs.org/api/addons.html)
37 | build/Release
38 |
39 | # Dependency directories
40 | node_modules/
41 | jspm_packages/
42 |
43 | # TypeScript v1 declaration files
44 | typings/
45 |
46 | # Optional npm cache directory
47 | .npm
48 |
49 | # Optional eslint cache
50 | .eslintcache
51 |
52 | # Optional REPL history
53 | .node_repl_history
54 |
55 | # Output of 'npm pack'
56 | *.tgz
57 |
58 | # Yarn Integrity file
59 | .yarn-integrity
60 |
61 | # dotenv environment variables file
62 | .env
63 |
64 | # next.js build output
65 | .next
66 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "10"
4 | - "8"
5 | env:
6 | - CXX=g++-4.8
7 | addons:
8 | apt:
9 | sources:
10 | - ubuntu-toolchain-r-test
11 | packages:
12 | - g++-4.8
13 |
14 | notifications:
15 | irc:
16 | channels:
17 | - "irc.freenode.org#periodicjs"
18 | template:
19 | - "Build by %{author} :"
20 | - "Git Info: %{branch} - %{commit} with the message %{commit_message}"
21 | - "Travis states: %{message}"
22 | - "Build Details: %{build_url}"
23 | - "Change View: %{compare_url}"
24 | - "result = %{result}"
25 | - "elapsed time... %{duration}"
26 | use_notice: true
27 | skip_join: false
28 |
29 | install:
30 | - npm install mocha nyc @std/esm -g
31 | - npm install
32 | # - npm install --skip_app_post_install=true
33 |
34 | branches:
35 | only:
36 | - master
37 | - devel
38 | git:
39 | submodules: false
40 |
41 | script:
42 | - npm set progress=false && npm run test && npm run coverage
43 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.4.0 (2019-05-09)
4 | - **Feat**
5 | - Added support for Model Saving and Loading
6 |
7 | ## 1.0.0 (2018-07-30)
8 |
9 | - **Feat**
10 | - First Initial Release
11 | - **Fix**
12 | - N/A
13 | - **Chore**
14 | - Allow for multistep future forecasts in multivariate timeseries.
15 | - Add basic clustering example.
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Repetere
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/API.md:
--------------------------------------------------------------------------------
1 | # Class
2 |
3 | # Function
--------------------------------------------------------------------------------
/docs/CNAME:
--------------------------------------------------------------------------------
1 | tensorscript.io
--------------------------------------------------------------------------------
/docs/badge.svg:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/docs/coverage.json:
--------------------------------------------------------------------------------
1 | {
2 | "coverage": "0%",
3 | "expectCount": 0,
4 | "actualCount": 0,
5 | "files": {}
6 | }
--------------------------------------------------------------------------------
/docs/css/github.css:
--------------------------------------------------------------------------------
1 | /* github markdown */
2 | .github-markdown {
3 | font-size: 16px;
4 | }
5 |
6 | .github-markdown h1,
7 | .github-markdown h2,
8 | .github-markdown h3,
9 | .github-markdown h4,
10 | .github-markdown h5 {
11 | margin-top: 1em;
12 | margin-bottom: 16px;
13 | font-weight: bold;
14 | padding: 0;
15 | }
16 |
17 | .github-markdown h1:nth-of-type(1) {
18 | margin-top: 0;
19 | }
20 |
21 | .github-markdown h1 {
22 | font-size: 2em;
23 | padding-bottom: 0.3em;
24 | }
25 |
26 | .github-markdown h2 {
27 | font-size: 1.75em;
28 | padding-bottom: 0.3em;
29 | }
30 |
31 | .github-markdown h3 {
32 | font-size: 1.5em;
33 | }
34 |
35 | .github-markdown h4 {
36 | font-size: 1.25em;
37 | }
38 |
39 | .github-markdown h5 {
40 | font-size: 1em;
41 | }
42 |
43 | .github-markdown ul, .github-markdown ol {
44 | padding-left: 2em;
45 | }
46 |
47 | .github-markdown pre > code {
48 | font-size: 0.85em;
49 | }
50 |
51 | .github-markdown table {
52 | margin-bottom: 1em;
53 | border-collapse: collapse;
54 | border-spacing: 0;
55 | }
56 |
57 | .github-markdown table tr {
58 | background-color: #fff;
59 | border-top: 1px solid #ccc;
60 | }
61 |
62 | .github-markdown table th,
63 | .github-markdown table td {
64 | padding: 6px 13px;
65 | border: 1px solid #ddd;
66 | }
67 |
68 | .github-markdown table tr:nth-child(2n) {
69 | background-color: #f8f8f8;
70 | }
71 |
72 | .github-markdown hr {
73 | border-right: 0;
74 | border-bottom: 1px solid #e5e5e5;
75 | border-left: 0;
76 | border-top: 0;
77 | }
78 |
79 | /** badge(.svg) does not have border */
80 | .github-markdown img:not([src*=".svg"]) {
81 | max-width: 100%;
82 | box-shadow: 1px 1px 1px rgba(0,0,0,0.5);
83 | }
84 |
--------------------------------------------------------------------------------
/docs/css/identifiers.css:
--------------------------------------------------------------------------------
1 | .identifiers-wrap {
2 | display: flex;
3 | align-items: flex-start;
4 | }
5 |
6 | .identifier-dir-tree {
7 | background: #fff;
8 | border: solid 1px #ddd;
9 | border-radius: 0.25em;
10 | top: 52px;
11 | position: -webkit-sticky;
12 | position: sticky;
13 | max-height: calc(100vh - 155px);
14 | overflow-y: scroll;
15 | min-width: 200px;
16 | margin-left: 1em;
17 | }
18 |
19 | .identifier-dir-tree-header {
20 | padding: 0.5em;
21 | background-color: #fafafa;
22 | border-bottom: solid 1px #ddd;
23 | }
24 |
25 | .identifier-dir-tree-content {
26 | padding: 0 0.5em 0;
27 | }
28 |
29 | .identifier-dir-tree-content > div {
30 | padding-top: 0.25em;
31 | padding-bottom: 0.25em;
32 | }
33 |
34 | .identifier-dir-tree-content a {
35 | color: inherit;
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/docs/css/manual.css:
--------------------------------------------------------------------------------
1 | .github-markdown .manual-toc {
2 | padding-left: 0;
3 | }
4 |
5 | .manual-index .manual-cards {
6 | display: flex;
7 | flex-wrap: wrap;
8 | }
9 |
10 | .manual-index .manual-card-wrap {
11 | width: 280px;
12 | padding: 10px 20px 10px 0;
13 | box-sizing: border-box;
14 | }
15 |
16 | .manual-index .manual-card-wrap > h1 {
17 | margin: 0;
18 | font-size: 1em;
19 | font-weight: 600;
20 | padding: 0.2em 0 0.2em 0.5em;
21 | border-radius: 0.1em 0.1em 0 0;
22 | border: none;
23 | }
24 |
25 | .manual-index .manual-card-wrap > h1 span {
26 | color: #555;
27 | }
28 |
29 | .manual-index .manual-card {
30 | height: 200px;
31 | overflow: hidden;
32 | border: solid 1px rgba(230, 230, 230, 0.84);
33 | border-radius: 0 0 0.1em 0.1em;
34 | padding: 8px;
35 | position: relative;
36 | }
37 |
38 | .manual-index .manual-card > div {
39 | transform: scale(0.4);
40 | transform-origin: 0 0;
41 | width: 250%;
42 | }
43 |
44 | .manual-index .manual-card > a {
45 | position: absolute;
46 | top: 0;
47 | left: 0;
48 | width: 100%;
49 | height: 100%;
50 | background: rgba(210, 210, 210, 0.1);
51 | }
52 |
53 | .manual-index .manual-card > a:hover {
54 | background: none;
55 | }
56 |
57 | .manual-index .manual-badge {
58 | margin: 0;
59 | }
60 |
61 | .manual-index .manual-user-index {
62 | margin-bottom: 1em;
63 | border-bottom: solid 1px #ddd;
64 | }
65 |
66 | .manual-root .navigation {
67 | padding-left: 4px;
68 | margin-top: 4px;
69 | }
70 |
71 | .navigation .manual-toc-root > div {
72 | padding-left: 0.25em;
73 | padding-right: 0.75em;
74 | }
75 |
76 | .github-markdown .manual-toc-title a {
77 | color: inherit;
78 | }
79 |
80 | .manual-breadcrumb-list {
81 | font-size: 0.8em;
82 | margin-bottom: 1em;
83 | }
84 |
85 | .manual-toc-title a:hover {
86 | color: #039BE5;
87 | }
88 |
89 | .manual-toc li {
90 | margin: 0.75em 0;
91 | list-style-type: none;
92 | }
93 |
94 | .navigation .manual-toc [class^="indent-h"] a {
95 | color: #666;
96 | }
97 |
98 | .navigation .manual-toc .indent-h1 a {
99 | color: #555;
100 | font-weight: 600;
101 | display: block;
102 | }
103 |
104 | .manual-toc .indent-h1 {
105 | display: block;
106 | margin: 0.4em 0 0 0.25em;
107 | padding: 0.2em 0 0.2em 0.5em;
108 | border-radius: 0.1em;
109 | }
110 |
111 | .manual-root .navigation .manual-toc li:not(.indent-h1) {
112 | margin-top: 0.5em;
113 | }
114 |
115 | .manual-toc .indent-h2 {
116 | display: none;
117 | margin-left: 1.5em;
118 | }
119 | .manual-toc .indent-h3 {
120 | display: none;
121 | margin-left: 2.5em;
122 | }
123 | .manual-toc .indent-h4 {
124 | display: none;
125 | margin-left: 3.5em;
126 | }
127 | .manual-toc .indent-h5 {
128 | display: none;
129 | margin-left: 4.5em;
130 | }
131 |
132 | .manual-nav li {
133 | margin: 0.75em 0;
134 | }
135 |
--------------------------------------------------------------------------------
/docs/css/prettify-tomorrow.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* Pretty printing styles. Used with prettify.js. */
4 | /* SPAN elements with the classes below are added by prettyprint. */
5 | /* plain text */
6 | .pln {
7 | color: #4d4d4c; }
8 |
9 | @media screen {
10 | /* string content */
11 | .str {
12 | color: #718c00; }
13 |
14 | /* a keyword */
15 | .kwd {
16 | color: #8959a8; }
17 |
18 | /* a comment */
19 | .com {
20 | color: #8e908c; }
21 |
22 | /* a type name */
23 | .typ {
24 | color: #4271ae; }
25 |
26 | /* a literal value */
27 | .lit {
28 | color: #f5871f; }
29 |
30 | /* punctuation */
31 | .pun {
32 | color: #4d4d4c; }
33 |
34 | /* lisp open bracket */
35 | .opn {
36 | color: #4d4d4c; }
37 |
38 | /* lisp close bracket */
39 | .clo {
40 | color: #4d4d4c; }
41 |
42 | /* a markup tag name */
43 | .tag {
44 | color: #c82829; }
45 |
46 | /* a markup attribute name */
47 | .atn {
48 | color: #f5871f; }
49 |
50 | /* a markup attribute value */
51 | .atv {
52 | color: #3e999f; }
53 |
54 | /* a declaration */
55 | .dec {
56 | color: #f5871f; }
57 |
58 | /* a variable name */
59 | .var {
60 | color: #c82829; }
61 |
62 | /* a function name */
63 | .fun {
64 | color: #4271ae; } }
65 | /* Use higher contrast and text-weight for printable form. */
66 | @media print, projection {
67 | .str {
68 | color: #060; }
69 |
70 | .kwd {
71 | color: #006;
72 | font-weight: bold; }
73 |
74 | .com {
75 | color: #600;
76 | font-style: italic; }
77 |
78 | .typ {
79 | color: #404;
80 | font-weight: bold; }
81 |
82 | .lit {
83 | color: #044; }
84 |
85 | .pun, .opn, .clo {
86 | color: #440; }
87 |
88 | .tag {
89 | color: #006;
90 | font-weight: bold; }
91 |
92 | .atn {
93 | color: #404; }
94 |
95 | .atv {
96 | color: #060; } }
97 | /* Style */
98 | /*
99 | pre.prettyprint {
100 | background: white;
101 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
102 | font-size: 12px;
103 | line-height: 1.5;
104 | border: 1px solid #ccc;
105 | padding: 10px; }
106 | */
107 |
108 | /* Specify class=linenums on a pre to get line numbering */
109 | ol.linenums {
110 | margin-top: 0;
111 | margin-bottom: 0; }
112 |
113 | /* IE indents via margin-left */
114 | li.L0,
115 | li.L1,
116 | li.L2,
117 | li.L3,
118 | li.L4,
119 | li.L5,
120 | li.L6,
121 | li.L7,
122 | li.L8,
123 | li.L9 {
124 | /* */ }
125 |
126 | /* Alternate shading for lines */
127 | li.L1,
128 | li.L3,
129 | li.L5,
130 | li.L7,
131 | li.L9 {
132 | /* */ }
133 |
--------------------------------------------------------------------------------
/docs/css/search.css:
--------------------------------------------------------------------------------
1 | /* search box */
2 | .search-box {
3 | position: absolute;
4 | top: 10px;
5 | right: 50px;
6 | padding-right: 8px;
7 | padding-bottom: 10px;
8 | line-height: normal;
9 | font-size: 12px;
10 | }
11 |
12 | .search-box img {
13 | width: 20px;
14 | vertical-align: top;
15 | }
16 |
17 | .search-input {
18 | display: inline;
19 | visibility: hidden;
20 | width: 0;
21 | padding: 2px;
22 | height: 1.5em;
23 | outline: none;
24 | background: transparent;
25 | border: 1px #0af;
26 | border-style: none none solid none;
27 | vertical-align: bottom;
28 | }
29 |
30 | .search-input-edge {
31 | display: none;
32 | width: 1px;
33 | height: 5px;
34 | background-color: #0af;
35 | vertical-align: bottom;
36 | }
37 |
38 | .search-result {
39 | position: absolute;
40 | display: none;
41 | height: 600px;
42 | width: 100%;
43 | padding: 0;
44 | margin-top: 5px;
45 | margin-left: 24px;
46 | background: white;
47 | box-shadow: 1px 1px 4px rgb(0,0,0);
48 | white-space: nowrap;
49 | overflow-y: scroll;
50 | }
51 |
52 | .search-result-import-path {
53 | color: #aaa;
54 | font-size: 12px;
55 | }
56 |
57 | .search-result li {
58 | list-style: none;
59 | padding: 2px 4px;
60 | }
61 |
62 | .search-result li a {
63 | display: block;
64 | }
65 |
66 | .search-result li.selected {
67 | background: #ddd;
68 | }
69 |
70 | .search-result li.search-separator {
71 | background: rgb(37, 138, 175);
72 | color: white;
73 | }
74 |
75 | .search-box.active .search-input {
76 | visibility: visible;
77 | transition: width 0.2s ease-out;
78 | width: 300px;
79 | }
80 |
81 | .search-box.active .search-input-edge {
82 | display: inline-block;
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/docs/css/source.css:
--------------------------------------------------------------------------------
1 | table.files-summary {
2 | width: 100%;
3 | margin: 10px 0;
4 | border-spacing: 0;
5 | border: 0;
6 | border-collapse: collapse;
7 | text-align: right;
8 | }
9 |
10 | table.files-summary tbody tr:hover {
11 | background: #eee;
12 | }
13 |
14 | table.files-summary td:first-child,
15 | table.files-summary td:nth-of-type(2) {
16 | text-align: left;
17 | }
18 |
19 | table.files-summary[data-use-coverage="false"] td.coverage {
20 | display: none;
21 | }
22 |
23 | table.files-summary thead {
24 | background: #fafafa;
25 | }
26 |
27 | table.files-summary td {
28 | border: solid 1px #ddd;
29 | padding: 4px 10px;
30 | vertical-align: top;
31 | }
32 |
33 | table.files-summary td.identifiers > span {
34 | display: block;
35 | margin-top: 4px;
36 | }
37 | table.files-summary td.identifiers > span:first-child {
38 | margin-top: 0;
39 | }
40 |
41 | table.files-summary .coverage-count {
42 | font-size: 12px;
43 | color: #aaa;
44 | display: inline-block;
45 | min-width: 40px;
46 | }
47 |
48 | .total-coverage-count {
49 | position: relative;
50 | bottom: 2px;
51 | font-size: 12px;
52 | color: #666;
53 | font-weight: 500;
54 | padding-left: 5px;
55 | }
56 |
--------------------------------------------------------------------------------
/docs/css/test.css:
--------------------------------------------------------------------------------
1 | table.test-summary thead {
2 | background: #fafafa;
3 | }
4 |
5 | table.test-summary thead .test-description {
6 | width: 50%;
7 | }
8 |
9 | table.test-summary {
10 | width: 100%;
11 | margin: 10px 0;
12 | border-spacing: 0;
13 | border: 0;
14 | border-collapse: collapse;
15 | }
16 |
17 | table.test-summary thead .test-count {
18 | width: 3em;
19 | }
20 |
21 | table.test-summary tbody tr:hover {
22 | background-color: #eee;
23 | }
24 |
25 | table.test-summary td {
26 | border: solid 1px #ddd;
27 | padding: 4px 10px;
28 | vertical-align: top;
29 | }
30 |
31 | table.test-summary td p {
32 | margin: 0;
33 | }
34 |
35 | table.test-summary tr.test-interface .toggle {
36 | display: inline-block;
37 | float: left;
38 | margin-right: 4px;
39 | cursor: pointer;
40 | font-size: 0.8em;
41 | padding-top: 0.25em;
42 | }
43 |
44 | table.test-summary tr.test-interface .toggle.opened:before {
45 | content: '▼';
46 | }
47 |
48 | table.test-summary tr.test-interface .toggle.closed:before {
49 | content: '▶';
50 | }
51 |
52 | table.test-summary .test-target > span {
53 | display: block;
54 | margin-top: 4px;
55 | }
56 | table.test-summary .test-target > span:first-child {
57 | margin-top: 0;
58 | }
59 |
--------------------------------------------------------------------------------
/docs/file/lib/classification.mjs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | lib/classification.mjs | TensorScript
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
34 |
35 |
49 |
50 | lib/classification.mjs
51 |
import { BaseNeuralNetwork, } from './deep_learning';
52 |
53 | /**
54 | * Deep Learning Classification with Tensorflow
55 | * @class DeepLearningClassification
56 | * @implements {BaseNeuralNetwork}
57 | */
58 | export class DeepLearningClassification extends BaseNeuralNetwork{
59 | /**
60 | * @param {{layers:Array<Object>,compile:Object,fit:Object}} options - neural network configuration and tensorflow model hyperparameters
61 | * @param {{model:Object,tf:Object,}} properties - extra instance properties
62 | */
63 | constructor(options = {}, properties) {
64 | const config = Object.assign({
65 | layers: [],
66 | compile: {
67 | loss: 'categoricalCrossentropy',
68 | optimizer: 'adam',
69 | },
70 | fit: {
71 | epochs: 100,
72 | batchSize: 5,
73 | },
74 | }, options);
75 | super(config, properties);
76 | return this;
77 | }
78 | /**
79 | * Adds dense layers to tensorflow classification model
80 | * @override
81 | * @param {Array<Array<number>>} x_matrix - independent variables
82 | * @param {Array<Array<number>>} y_matrix - dependent variables
83 | * @param {Array<Object>} layers - model dense layer parameters
84 | */
85 | generateLayers(x_matrix, y_matrix, layers) {
86 | const xShape = this.getInputShape(x_matrix);
87 | const yShape = this.getInputShape(y_matrix);
88 | this.yShape = yShape;
89 | this.xShape = xShape;
90 | const denseLayers = [];
91 | if (layers) {
92 | denseLayers.push(...layers);
93 | } else {
94 | denseLayers.push({ units: (xShape[ 1 ] * 2), inputDim: xShape[1], activation: 'relu', });
95 | denseLayers.push({ units: yShape[ 1 ], activation: 'softmax', });
96 | }
97 | this.layers = denseLayers;
98 | denseLayers.forEach(layer => {
99 | this.model.add(this.tf.layers.dense(layer));
100 | });
101 | }
102 | }
103 |
104 |
105 |
106 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/docs/file/lib/deeplearning.mjs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | lib/deeplearning.mjs | @tensorscript/ts-deeplearning
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
40 |
41 | lib/deeplearning.mjs
42 |
import { TensorScriptModelInterface, } from '@tensorscript/core';
43 |
44 | /**
45 | * Deep Learning with Tensorflow
46 | * @class BaseNeuralNetwork
47 | * @implements {TensorScriptModelInterface}
48 | */
49 | export class BaseNeuralNetwork extends TensorScriptModelInterface {
50 | /**
51 | * @param {{layers:Array<Object>,compile:Object,fit:Object}} options - neural network configuration and tensorflow model hyperparameters
52 | * @param {{model:Object,tf:Object,}} properties - extra instance properties
53 | */
54 | constructor(options = {}, properties) {
55 | const config = Object.assign({
56 | layers: [],
57 | compile: {
58 | loss: 'meanSquaredError',
59 | optimizer: 'adam',
60 | },
61 | fit: {
62 | epochs: 100,
63 | batchSize: 5,
64 | },
65 | }, options);
66 | super(config, properties);
67 | return this;
68 | }
69 | /**
70 | * Adds dense layers to tensorflow model
71 | * @abstract
72 | * @param {Array<Array<number>>} x_matrix - independent variables
73 | * @param {Array<Array<number>>} y_matrix - dependent variables
74 | * @param {Array<Object>} layers - model dense layer parameters
75 | */
76 | generateLayers(x_matrix, y_matrix, layers) {
77 | throw new ReferenceError('generateLayers method is not implemented');
78 | }
79 | /**
80 | * Asynchronously trains tensorflow model
81 | * @override
82 | * @param {Array<Array<number>>} x_matrix - independent variables
83 | * @param {Array<Array<number>>} y_matrix - dependent variables
84 | * @param {Array<Object>} layers - array of model dense layer parameters
85 | * @param {Array<Array<number>>} x_text - validation data independent variables
86 | * @param {Array<Array<number>>} y_text - validation data dependent variables
87 | * @return {Object} returns trained tensorflow model
88 | */
89 | async train(x_matrix, y_matrix, layers, x_test, y_test) {
90 | const xShape = this.getInputShape(x_matrix);
91 | const yShape = this.getInputShape(y_matrix);
92 | const xs = this.tf.tensor(x_matrix, xShape);
93 | const ys = this.tf.tensor(y_matrix, yShape);
94 | this.xShape = xShape;
95 | this.yShape = yShape;
96 | this.model = this.tf.sequential();
97 | this.generateLayers.call(this, x_matrix, y_matrix, layers || this.layers, x_test, y_test);
98 | this.model.compile(this.settings.compile);
99 | await this.model.fit(xs, ys, this.settings.fit);
100 | xs.dispose();
101 | ys.dispose();
102 | return this.model;
103 | }
104 | /**
105 | * Predicts new dependent variables
106 | * @override
107 | * @param {Array<Array<number>>|Array<number>} matrix - new test independent variables
108 | * @return {{data: Promise}} returns tensorflow prediction
109 | */
110 | calculate(input_matrix) {
111 | if (!input_matrix || Array.isArray(input_matrix)===false) throw new Error('invalid input matrix');
112 | const predictionInput = (Array.isArray(input_matrix[ 0 ]))
113 | ? input_matrix
114 | : [
115 | input_matrix,
116 | ];
117 | const predictionTensor = this.tf.tensor(predictionInput);
118 | const prediction = this.model.predict(predictionTensor);
119 | predictionTensor.dispose();
120 | return prediction;
121 | }
122 | }
123 |
124 |
125 |
126 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/docs/file/lib/mlr.mjs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | lib/mlr.mjs | @tensorscript/ts-mlr
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
36 |
37 | lib/mlr.mjs
38 |
import { TensorScriptModelInterface, } from '@tensorscript/core';
39 |
40 | /**
41 | * Mulitple Linear Regression with Tensorflow
42 | * @class MultipleLinearRegression
43 | * @implements {TensorScriptModelInterface}
44 | */
45 | export class MultipleLinearRegression extends TensorScriptModelInterface {
46 | /**
47 | * @param {Object} options - tensorflow model hyperparameters
48 | * @param {Object} customTF - custom tensorflow module: tensorflow / tensorflow-node / tensorflow-node-gpu
49 | */
50 | constructor(options = {}, customTF) {
51 | const config = Object.assign({
52 | epochs:500,
53 | }, options);
54 | super(config, customTF);
55 | return this;
56 | }
57 | /**
58 | * Asynchronously trains tensorflow model
59 | * @override
60 | * @param {Array<Array<number>>} x_matrix - independent variables
61 | * @param {Array<Array<number>>} y_matrix - dependent variables
62 | * @return {Object} returns trained tensorflow model
63 | */
64 | async train(x_matrix, y_matrix) {
65 | const xShape = this.getInputShape(x_matrix);
66 | const yShape = this.getInputShape(y_matrix);
67 | const xs = this.tf.tensor(x_matrix, xShape);
68 | const ys = this.tf.tensor(y_matrix, yShape);
69 | this.yShape = yShape;
70 | this.xShape = xShape;
71 | this.model = this.tf.sequential();
72 | this.model.add(this.tf.layers.dense({ units: yShape[1], inputShape: [xShape[1],], }));
73 | this.model.compile({
74 | loss: 'meanSquaredError',
75 | optimizer: 'sgd',
76 | });
77 | await this.model.fit(xs, ys, this.settings);
78 | xs.dispose();
79 | ys.dispose();
80 | return this.model;
81 | }
82 | /**
83 | * Predicts new dependent variables
84 | * @override
85 | * @param {Array<Array<number>>|Array<number>} matrix - new test independent variables
86 | * @return {{data: Promise}} returns tensorflow prediction
87 | */
88 | calculate(input_matrix) {
89 | const predictionInput = (Array.isArray(input_matrix[ 0 ]))
90 | ? input_matrix
91 | : [ input_matrix, ];
92 | const predictionTensor = this.tf.tensor(predictionInput);
93 | const prediction = this.model.predict(predictionTensor);
94 | predictionTensor.dispose();
95 | return prediction;
96 | }
97 | }
98 |
99 |
100 |
101 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/docs/file/lib/multiple_linear_regression.mjs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | lib/multiple_linear_regression.mjs | TensorScript
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
34 |
35 |
49 |
50 | lib/multiple_linear_regression.mjs
51 |
import { BaseNeuralNetwork, } from './deep_learning';
52 |
53 | /**
54 | * Mulitple Linear Regression with Tensorflow
55 | * @class MultipleLinearRegression
56 | * @implements {BaseNeuralNetwork}
57 | */
58 | export class MultipleLinearRegression extends BaseNeuralNetwork {
59 | /**
60 | * @param {{layers:Array<Object>,compile:Object,fit:Object}} options - neural network configuration and tensorflow model hyperparameters
61 | * @param {{model:Object,tf:Object,}} properties - extra instance properties
62 | */
63 | /* istanbul ignore next */
64 | constructor(options = {}, properties = {}) {
65 | const config = Object.assign({
66 | layers: [],
67 | compile: {
68 | loss: 'meanSquaredError',
69 | optimizer: 'sgd',
70 | },
71 | fit: {
72 | epochs: 500,
73 | batchSize: 5,
74 | },
75 | }, options);
76 | super(config, properties);
77 | return this;
78 | }
79 | /**
80 | * Adds dense layers to tensorflow regression model
81 | * @override
82 | * @param {Array<Array<number>>} x_matrix - independent variables
83 | * @param {Array<Array<number>>} y_matrix - dependent variables
84 | * @param {Array<Object>} layers - model dense layer parameters
85 | */
86 | generateLayers(x_matrix, y_matrix, layers) {
87 | const xShape = this.getInputShape(x_matrix);
88 | const yShape = this.getInputShape(y_matrix);
89 | const denseLayers = [];
90 | if (layers) {
91 | denseLayers.push(...layers);
92 | } else {
93 | denseLayers.push({ units: yShape[1], inputShape: [xShape[1],], });
94 | }
95 | this.layers = denseLayers;
96 | denseLayers.forEach(layer => {
97 | this.model.add(this.tf.layers.dense(layer));
98 | });
99 | }
100 | }
101 |
102 |
103 |
104 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/docs/gtm.js:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/docs/identifiers.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Reference | TensorScript
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
34 |
35 |
41 |
42 | References
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/docs/image/badge.svg:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/docs/image/esdoc-logo-mini-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/repetere/tensorscript/8ec5126a3b27d938c77158145f9bce47ffdb108d/docs/image/esdoc-logo-mini-black.png
--------------------------------------------------------------------------------
/docs/image/esdoc-logo-mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/repetere/tensorscript/8ec5126a3b27d938c77158145f9bce47ffdb108d/docs/image/esdoc-logo-mini.png
--------------------------------------------------------------------------------
/docs/image/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/repetere/tensorscript/8ec5126a3b27d938c77158145f9bce47ffdb108d/docs/image/github.png
--------------------------------------------------------------------------------
/docs/image/manual-badge.svg:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/docs/image/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/repetere/tensorscript/8ec5126a3b27d938c77158145f9bce47ffdb108d/docs/image/search.png
--------------------------------------------------------------------------------
/docs/manual/CHANGELOG.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Manual | TensorScript
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
34 |
35 |
77 |
78 | Changelog
1.4.0 (2019-05-09)
79 | - Feat
80 | - Added support for Model Saving and Loading
81 |
82 |
83 |
84 |
1.0.0 (2018-07-30)
85 | - Feat
86 | - First Initial Release
87 |
88 |
89 | - Fix
92 |
93 | - Chore
94 | - Allow for multistep future forecasts in multivariate timeseries.
95 | - Add basic clustering example.
96 |
97 |
98 |
99 |
100 |
101 |
102 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/docs/manual/configuration.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Manual | TensorScript
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
85 |
86 | config
this is the overview
87 |
88 |
89 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/docs/manual/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Manual | TensorScript
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
85 |
86 | example
this is the overview
87 |
88 |
89 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/docs/manual/faq.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Manual | TensorScript
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
34 |
35 |
77 |
78 | Frequently Asked Questions
Scaling
79 | - How do I scale and descale my inputs?
80 | - The library is only for model create, data engineering and modeling is typically handled elsewhere
81 | - Check out the regression examples (hint: use ModelScript).
82 |
83 |
84 | - How do I cross validate, test/train split, K-fold, etc?
85 | - (See above) The library is only for model create, data engineering and modeling is typically handled elsewhere
86 | - Check out the code examples (hint: use ModelScript).
87 |
88 |
89 |
90 |
91 |
92 |
93 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/docs/manual/installation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Manual | TensorScript
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
85 |
86 | install
this is the overview
87 |
88 |
89 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/docs/manual/tutorial.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Manual | TensorScript
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
85 |
86 | tutorial
this is the overview
87 |
88 |
89 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/docs/script/inherited-summary.js:
--------------------------------------------------------------------------------
1 | (function(){
2 | function toggle(ev) {
3 | var button = ev.target;
4 | var parent = ev.target.parentElement;
5 | while(parent) {
6 | if (parent.tagName === 'TABLE' && parent.classList.contains('summary')) break;
7 | parent = parent.parentElement;
8 | }
9 |
10 | if (!parent) return;
11 |
12 | var tbody = parent.querySelector('tbody');
13 | if (button.classList.contains('opened')) {
14 | button.classList.remove('opened');
15 | button.classList.add('closed');
16 | tbody.style.display = 'none';
17 | } else {
18 | button.classList.remove('closed');
19 | button.classList.add('opened');
20 | tbody.style.display = 'block';
21 | }
22 | }
23 |
24 | var buttons = document.querySelectorAll('.inherited-summary thead .toggle');
25 | for (var i = 0; i < buttons.length; i++) {
26 | buttons[i].addEventListener('click', toggle);
27 | }
28 | })();
29 |
--------------------------------------------------------------------------------
/docs/script/inner-link.js:
--------------------------------------------------------------------------------
1 | // inner link(#foo) can not correctly scroll, because page has fixed header,
2 | // so, I manually scroll.
3 | (function(){
4 | var matched = location.hash.match(/errorLines=([\d,]+)/);
5 | if (matched) return;
6 |
7 | function adjust() {
8 | window.scrollBy(0, -55);
9 | var el = document.querySelector('.inner-link-active');
10 | if (el) el.classList.remove('inner-link-active');
11 |
12 | // ``[ ] . ' " @`` are not valid in DOM id. so must escape these.
13 | var id = location.hash.replace(/([\[\].'"@$])/g, '\\$1');
14 | var el = document.querySelector(id);
15 | if (el) el.classList.add('inner-link-active');
16 | }
17 |
18 | window.addEventListener('hashchange', adjust);
19 |
20 | if (location.hash) {
21 | setTimeout(adjust, 0);
22 | }
23 | })();
24 |
25 | (function(){
26 | var els = document.querySelectorAll('[href^="#"]');
27 | var href = location.href.replace(/#.*$/, ''); // remove existed hash
28 | for (var i = 0; i < els.length; i++) {
29 | var el = els[i];
30 | el.href = href + el.getAttribute('href'); // because el.href is absolute path
31 | }
32 | })();
33 |
--------------------------------------------------------------------------------
/docs/script/manual.js:
--------------------------------------------------------------------------------
1 | (function(){
2 | var matched = location.pathname.match(/\/(manual\/.*\.html)$/);
3 | if (!matched) return;
4 |
5 | var currentName = matched[1];
6 | var cssClass = '.navigation .manual-toc li[data-link="' + currentName + '"]';
7 | var styleText = cssClass + '{ display: block; }\n';
8 | styleText += cssClass + '.indent-h1 a { color: #039BE5 }';
9 | var style = document.createElement('style');
10 | style.textContent = styleText;
11 | document.querySelector('head').appendChild(style);
12 | })();
13 |
--------------------------------------------------------------------------------
/docs/script/patch-for-local.js:
--------------------------------------------------------------------------------
1 | (function(){
2 | if (location.protocol === 'file:') {
3 | var elms = document.querySelectorAll('a[href="./"]');
4 | for (var i = 0; i < elms.length; i++) {
5 | elms[i].href = './index.html';
6 | }
7 | }
8 | })();
9 |
--------------------------------------------------------------------------------
/docs/script/pretty-print.js:
--------------------------------------------------------------------------------
1 | (function(){
2 | prettyPrint();
3 | var lines = document.querySelectorAll('.prettyprint.linenums li[class^="L"]');
4 | for (var i = 0; i < lines.length; i++) {
5 | lines[i].id = 'lineNumber' + (i + 1);
6 | }
7 |
8 | var matched = location.hash.match(/errorLines=([\d,]+)/);
9 | if (matched) {
10 | var lines = matched[1].split(',');
11 | for (var i = 0; i < lines.length; i++) {
12 | var id = '#lineNumber' + lines[i];
13 | var el = document.querySelector(id);
14 | el.classList.add('error-line');
15 | }
16 | return;
17 | }
18 |
19 | if (location.hash) {
20 | // ``[ ] . ' " @`` are not valid in DOM id. so must escape these.
21 | var id = location.hash.replace(/([\[\].'"@$])/g, '\\$1');
22 | var line = document.querySelector(id);
23 | if (line) line.classList.add('active');
24 | }
25 | })();
26 |
--------------------------------------------------------------------------------
/docs/script/search.js:
--------------------------------------------------------------------------------
1 | (function(){
2 | var searchIndex = window.esdocSearchIndex;
3 | var searchBox = document.querySelector('.search-box');
4 | var input = document.querySelector('.search-input');
5 | var result = document.querySelector('.search-result');
6 | var selectedIndex = -1;
7 | var prevText;
8 |
9 | // active search box and focus when mouse enter on search box.
10 | searchBox.addEventListener('mouseenter', function(){
11 | searchBox.classList.add('active');
12 | input.focus();
13 | });
14 |
15 | // search with text when key is upped.
16 | input.addEventListener('keyup', function(ev){
17 | var text = ev.target.value.toLowerCase();
18 | if (!text) {
19 | result.style.display = 'none';
20 | result.innerHTML = '';
21 | return;
22 | }
23 |
24 | if (text === prevText) return;
25 | prevText = text;
26 |
27 | var html = {class: [], method: [], member: [], function: [], variable: [], typedef: [], external: [], file: [], test: [], testFile: []};
28 | var len = searchIndex.length;
29 | var kind;
30 | for (var i = 0; i < len; i++) {
31 | var pair = searchIndex[i];
32 | if (pair[0].indexOf(text) !== -1) {
33 | kind = pair[3];
34 | html[kind].push('' + pair[2] + '');
35 | }
36 | }
37 |
38 | var innerHTML = '';
39 | for (kind in html) {
40 | var list = html[kind];
41 | if (!list.length) continue;
42 | innerHTML += '' + kind + '\n' + list.join('\n');
43 | }
44 | result.innerHTML = innerHTML;
45 | if (innerHTML) result.style.display = 'block';
46 | selectedIndex = -1;
47 | });
48 |
49 | // down, up and enter key are pressed, select search result.
50 | input.addEventListener('keydown', function(ev){
51 | if (ev.keyCode === 40) {
52 | // arrow down
53 | var current = result.children[selectedIndex];
54 | var selected = result.children[selectedIndex + 1];
55 | if (selected && selected.classList.contains('search-separator')) {
56 | var selected = result.children[selectedIndex + 2];
57 | selectedIndex++;
58 | }
59 |
60 | if (selected) {
61 | if (current) current.classList.remove('selected');
62 | selectedIndex++;
63 | selected.classList.add('selected');
64 | }
65 | } else if (ev.keyCode === 38) {
66 | // arrow up
67 | var current = result.children[selectedIndex];
68 | var selected = result.children[selectedIndex - 1];
69 | if (selected && selected.classList.contains('search-separator')) {
70 | var selected = result.children[selectedIndex - 2];
71 | selectedIndex--;
72 | }
73 |
74 | if (selected) {
75 | if (current) current.classList.remove('selected');
76 | selectedIndex--;
77 | selected.classList.add('selected');
78 | }
79 | } else if (ev.keyCode === 13) {
80 | // enter
81 | var current = result.children[selectedIndex];
82 | if (current) {
83 | var link = current.querySelector('a');
84 | if (link) location.href = link.href;
85 | }
86 | } else {
87 | return;
88 | }
89 |
90 | ev.preventDefault();
91 | });
92 |
93 | // select search result when search result is mouse over.
94 | result.addEventListener('mousemove', function(ev){
95 | var current = result.children[selectedIndex];
96 | if (current) current.classList.remove('selected');
97 |
98 | var li = ev.target;
99 | while (li) {
100 | if (li.nodeName === 'LI') break;
101 | li = li.parentElement;
102 | }
103 |
104 | if (li) {
105 | selectedIndex = Array.prototype.indexOf.call(result.children, li);
106 | li.classList.add('selected');
107 | }
108 | });
109 |
110 | // clear search result when body is clicked.
111 | document.body.addEventListener('click', function(ev){
112 | selectedIndex = -1;
113 | result.style.display = 'none';
114 | result.innerHTML = '';
115 | });
116 |
117 | })();
118 |
--------------------------------------------------------------------------------
/docs/script/search_index.js:
--------------------------------------------------------------------------------
1 | window.esdocSearchIndex = []
--------------------------------------------------------------------------------
/docs/script/test-summary.js:
--------------------------------------------------------------------------------
1 | (function(){
2 | function toggle(ev) {
3 | var button = ev.target;
4 | var parent = ev.target.parentElement;
5 | while(parent) {
6 | if (parent.tagName === 'TR' && parent.classList.contains('test-interface')) break;
7 | parent = parent.parentElement;
8 | }
9 |
10 | if (!parent) return;
11 |
12 | var direction;
13 | if (button.classList.contains('opened')) {
14 | button.classList.remove('opened');
15 | button.classList.add('closed');
16 | direction = 'closed';
17 | } else {
18 | button.classList.remove('closed');
19 | button.classList.add('opened');
20 | direction = 'opened';
21 | }
22 |
23 | var targetDepth = parseInt(parent.dataset.testDepth, 10) + 1;
24 | var nextElement = parent.nextElementSibling;
25 | while (nextElement) {
26 | var depth = parseInt(nextElement.dataset.testDepth, 10);
27 | if (depth >= targetDepth) {
28 | if (direction === 'opened') {
29 | if (depth === targetDepth) nextElement.style.display = '';
30 | } else if (direction === 'closed') {
31 | nextElement.style.display = 'none';
32 | var innerButton = nextElement.querySelector('.toggle');
33 | if (innerButton && innerButton.classList.contains('opened')) {
34 | innerButton.classList.remove('opened');
35 | innerButton.classList.add('closed');
36 | }
37 | }
38 | } else {
39 | break;
40 | }
41 | nextElement = nextElement.nextElementSibling;
42 | }
43 | }
44 |
45 | var buttons = document.querySelectorAll('.test-summary tr.test-interface .toggle');
46 | for (var i = 0; i < buttons.length; i++) {
47 | buttons[i].addEventListener('click', toggle);
48 | }
49 |
50 | var topDescribes = document.querySelectorAll('.test-summary tr[data-test-depth="0"]');
51 | for (var i = 0; i < topDescribes.length; i++) {
52 | topDescribes[i].style.display = '';
53 | }
54 | })();
55 |
--------------------------------------------------------------------------------
/docs/source.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Source | TensorScript
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
34 |
35 |
41 |
42 | Source
0/0
43 |
44 |
45 |
46 |
47 | File |
48 | Identifier |
49 | Document |
50 | Size |
51 | Lines |
52 | Updated |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | export { TensorScriptModelInterface, } from './lib/model_interface.js';
2 | export { BaseNeuralNetwork, } from './lib/deep_learning.js';
3 | export { DeepLearningRegression, } from './lib/regression.js';
4 | export { DeepLearningClassification, } from './lib/classification.js';
5 | export { LogisticRegression, } from './lib/logistic_regression.js';
6 | export { MultipleLinearRegression, } from './lib/multiple_linear_regression.js';
7 | export { LSTMTimeSeries, } from './lib/lstm_time_series.js';
8 | export { LSTMMultivariateTimeSeries, } from './lib/lstm_multivariate_time_series.js';
9 | export { TextEmbedding, } from './lib/text_embedding.js';
--------------------------------------------------------------------------------
/lib/classification.js:
--------------------------------------------------------------------------------
1 | import { BaseNeuralNetwork, } from './deep_learning';
2 |
3 | /**
4 | * Deep Learning Classification with Tensorflow
5 | * @class DeepLearningClassification
6 | * @implements {BaseNeuralNetwork}
7 | */
8 | export class DeepLearningClassification extends BaseNeuralNetwork{
9 | /**
10 | * @param {{layers:Array