|
1 | 1 | ## Development
|
2 | 2 |
|
3 |
| -<<<<<<< HEAD |
4 |
| -This repository contains only the logic and scripts that combine |
5 |
| -two packages: |
6 |
| -- [TensorFlow.js Core](https://github.com/tensorflow/tfjs-core), |
7 |
| - a flexible low-level API, formerly known as *deeplearn.js*. |
8 |
| -- [TensorFlow.js Layers](https://github.com/tensorflow/tfjs-layers), |
9 |
| - a high-level API which implements functionality similar to |
| 3 | +This repository contains only the logic and scripts that combine the following NPM packages: |
| 4 | +- TensorFlow.js Core (@tensorflow/tfjs-core), |
| 5 | + a flexible low-level linear algebra and gradients API. |
| 6 | +- TensorFlow.js Layers (@tensorflow/tfjs-layers), |
| 7 | + a high-level model-centric API which implements functionality similar to |
10 | 8 | [Keras](https://keras.io/).
|
| 9 | +- TensorFlow.js Converter (@tensorflow/tfjs-converter), |
| 10 | + a library to load converted TensorFlow SavedModels and execute them in JavaScript. |
| 11 | +- TensorFlow.js Data (@tensorflow/tfjs-data), |
| 12 | + a library to load and prepare data for use in machine learning models. |
| 13 | + |
| 14 | +#### Yarn |
| 15 | +We use yarn, and if you are adding or removing dependencies you should use yarn |
| 16 | +to keep the `yarn.lock` file up to date. |
| 17 | + |
| 18 | +#### Code editor |
| 19 | +We recommend using [Visual Studio Code](https://code.visualstudio.com/) for |
| 20 | +development. Make sure to install |
| 21 | +[TSLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin) |
| 22 | +and the npm [clang-format](https://github.com/angular/clang-format) `1.2.2` or later |
| 23 | +with the |
| 24 | +[Clang-Format VSCode extension](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format) |
| 25 | +for auto-formatting. |
| 26 | + |
| 27 | +#### Testing |
| 28 | +Before submitting a pull request, make sure the code passes all the tests and is clean of lint errors: |
| 29 | + |
| 30 | +```bash |
| 31 | +# cd into the package directory you want to test |
| 32 | +$ yarn test |
| 33 | +$ yarn lint |
| 34 | +``` |
| 35 | + |
| 36 | +To run a subset of tests and/or on a specific browser: |
| 37 | + |
| 38 | +```bash |
| 39 | +$ yarn test --browsers=Chrome --grep='multinomial' |
| 40 | + |
| 41 | +> ... |
| 42 | +> Chrome 62.0.3202 (Mac OS X 10.12.6): Executed 28 of 1891 (skipped 1863) SUCCESS (6.914 secs / 0.634 secs) |
| 43 | +``` |
| 44 | + |
| 45 | +To run the tests once and exit the karma process (helpful on Windows): |
| 46 | + |
| 47 | +```bash |
| 48 | +$ yarn test --single-run |
| 49 | +``` |
| 50 | + |
| 51 | +To run the tests in an environment that does not have GPU support (such as Chrome Remote Desktop): |
| 52 | + |
| 53 | +```bash |
| 54 | +$ yarn test --testEnv cpu |
| 55 | +``` |
| 56 | + |
| 57 | +Available test environments: cpu, webgl1, webgl2. |
| 58 | + |
| 59 | +#### Packaging (browser and npm) |
| 60 | + |
| 61 | +In any of the directories the following commands build the NPM tarball: |
| 62 | + |
| 63 | +```bash |
| 64 | +$ yarn build-npm |
| 65 | +> Stored standalone library at dist/tf-core(.min).js |
| 66 | +> Stored also tensorflow-tf-core-VERSION.tgz |
| 67 | +``` |
| 68 | + |
| 69 | +To install it locally, run `yarn add ./tensorflow-tf-core-VERSION.tgz`. |
| 70 | + |
| 71 | +> On Windows, use bash (available through git) to use the scripts above. |
| 72 | +
|
| 73 | +Looking to contribute, and don't know where to start? Check out our "stat:contributions welcome" [issues](https://github.com/tensorflow/tfjs/labels/stat%3Acontributions%20welcome). |
11 | 74 |
|
12 |
| -To develop: |
13 |
| -- `tfjs-core`, see [this doc](https://github.com/tensorflow/tfjs-core/blob/master/DEVELOPMENT.md). |
14 |
| -- `tfjs-layers` see [this doc](https://github.com/tensorflow/tfjs-layers/blob/master/DEVELOPMENT.md). |
15 |
| -- `tfjs` with locally modified `tfjs-layers` (or `tfjs-core`) see [this section](https://github.com/tensorflow/tfjs-layers/blob/master/DEVELOPMENT.md#changing-tensorflowtfjs-layers-and-testing-tensorflowtfjs) in [tfjs-layers/DEVELOPMENT.md](https://github.com/tensorflow/tfjs-layers) repo. |
16 | 75 |
|
17 | 76 | ## For repository owners: commit style guide
|
18 | 77 |
|
@@ -74,71 +133,11 @@ This will show up under "Features" as:
|
74 | 133 |
|
75 | 134 | This will also show up under "Performance" as:
|
76 | 135 | - Improve matMul CPU speed by 100%. (Improvements to matMul.) (#900). Thanks, @externalcontributor.
|
77 |
| -======= |
78 | 136 | To build **TensorFlow.js Core API** from source, we need to clone the project and prepare
|
79 | 137 | the dev environment:
|
80 | 138 |
|
81 | 139 | ```bash
|
82 | 140 | $ git clone https://github.com/tensorflow/tfjs-core.git
|
83 | 141 | $ cd tfjs-core
|
84 | 142 | $ yarn # Installs dependencies.
|
85 |
| -``` |
86 |
| - |
87 |
| -#### Yarn |
88 |
| -We use yarn, and if you are adding or removing dependencies you should use yarn |
89 |
| -to keep the `yarn.lock` file up to date. |
90 |
| - |
91 |
| -#### Code editor |
92 |
| -We recommend using [Visual Studio Code](https://code.visualstudio.com/) for |
93 |
| -development. Make sure to install |
94 |
| -[TSLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin) |
95 |
| -and the npm [clang-format](https://github.com/angular/clang-format) `1.2.2` or later |
96 |
| -with the |
97 |
| -[Clang-Format VSCode extension](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format) |
98 |
| -for auto-formatting. |
99 |
| - |
100 |
| -#### Testing |
101 |
| -Before submitting a pull request, make sure the code passes all the tests and is clean of lint errors: |
102 |
| - |
103 |
| -```bash |
104 |
| -$ yarn test |
105 |
| -$ yarn lint |
106 |
| -``` |
107 |
| - |
108 |
| -To run a subset of tests and/or on a specific browser: |
109 |
| - |
110 |
| -```bash |
111 |
| -$ yarn test --browsers=Chrome --grep='multinomial' |
112 |
| - |
113 |
| -> ... |
114 |
| -> Chrome 62.0.3202 (Mac OS X 10.12.6): Executed 28 of 1891 (skipped 1863) SUCCESS (6.914 secs / 0.634 secs) |
115 |
| -``` |
116 |
| - |
117 |
| -To run the tests once and exit the karma process (helpful on Windows): |
118 |
| - |
119 |
| -```bash |
120 |
| -$ yarn test --single-run |
121 |
| -``` |
122 |
| - |
123 |
| -To run the tests in an environment that does not have GPU support (such as Chrome Remote Desktop): |
124 |
| - |
125 |
| -```bash |
126 |
| -$ yarn test --testEnv cpu |
127 |
| -``` |
128 |
| - |
129 |
| -Available test environments: cpu, webgl1, webgl2. |
130 |
| - |
131 |
| -#### Packaging (browser and npm) |
132 |
| - |
133 |
| -```bash |
134 |
| -$ yarn build-npm |
135 |
| -> Stored standalone library at dist/tf-core(.min).js |
136 |
| -> Stored also tensorflow-tf-core-VERSION.tgz |
137 |
| -``` |
138 |
| - |
139 |
| -To install it locally, run `yarn add ./tensorflow-tf-core-VERSION.tgz`. |
140 |
| - |
141 |
| -> On Windows, use bash (available through git) to use the scripts above. |
142 |
| -
|
143 |
| -Looking to contribute, and don't know where to start? Check out our "stat:contributions welcome" [issues](https://github.com/tensorflow/tfjs/labels/stat%3Acontributions%20welcome). |
144 |
| ->>>>>>> tfjs-core/master |
| 143 | +``` |
0 commit comments