Skip to content

Commit 8e419c6

Browse files
authored
Merge pull request #228 from javascriptdata/updated-readme
updated readme
2 parents a64c5ba + eef2f5c commit 8e419c6

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ Documentation site: [www.scikitjs.org](https://www.scikitjs.org)
2121
For use with modern bundlers in a frontend application, simply
2222

2323
```bash
24+
npm i @tensorflow/tfjs
2425
npm i scikitjs
2526
```
2627

27-
Usage is similar to other js libraries. We depend on the tensorflow library in order to make our calculations fast, but we don't ship it in our bundle. We use it as a peer dependency. General usage is as follows.
28+
We depend on the tensorflow library in order to make our calculations fast, but we don't ship it in our bundle.
29+
We use it as a peer dependency. General usage is as follows.
2830

2931
```js
3032
import * as tf from '@tensorflow/tfjs'
31-
import { LinearRegression, setBackend } from 'scikitjs'
32-
setBackend(tf)
33+
import * as sk from 'scikitjs'
34+
sk.setBackend(tf)
3335
```
3436

3537
This allows us to build a library that can be used in Deno, Node, and the browser with the same configuration.
@@ -38,15 +40,14 @@ This allows us to build a library that can be used in Deno, Node, and the browse
3840
For Node.js users who wish to bind to the Tensorflow C++ library, simply import the tensorflow C++ version, and use that as the tf library
3941

4042
```bash
43+
npm i @tensorflow/tfjs-node
4144
npm i scikitjs
4245
```
4346

44-
But then import the node bindings
45-
4647
```js
4748
import * as tf from '@tensorflow/tfjs-node'
48-
import { LinearRegression, setBackend } from 'scikitjs'
49-
setBackend(tf)
49+
import * as sk from 'scikitjs'
50+
sk.setBackend(tf)
5051
```
5152

5253
### Script src
@@ -57,16 +58,18 @@ For those that wish to use script src tags, simply
5758
<script type="module">
5859
import * as tf from 'https://cdn.skypack.dev/@tensorflow/tfjs'
5960
import * as sk from 'https://cdn.skypack.dev/scikitjs'
60-
// or alternatively you can pull the bundle from unpkg >>> import * as sk from "https://unpkg.com/scikitjs/dist/web index.min.js"
6161
sk.setBackend(tf)
62+
63+
// or alternatively you can pull the bundle from unpkg
64+
// import * as sk from "https://unpkg.com/scikitjs/dist/web index.min.js"
6265
</script>
6366
```
6467

6568
## Simple Example
6669

6770
```js
6871
import * as tf from '@tensorflow/tfjs-node'
69-
import { LinearRegression, setBackend } from 'scikitjs'
72+
import { setBackend, LinearRegression } from 'scikitjs'
7073
setBackend(tf)
7174

7275
const lr = new LinearRegression({ fitIntercept: false })
@@ -126,7 +129,7 @@ Turns into
126129

127130
```js
128131
import * as tf from '@tensorflow/tfjs-node'
129-
import { LinearRegression, setBackend } from 'scikitjs'
132+
import { setBackend, LinearRegression } from 'scikitjs'
130133
setBackend(tf)
131134

132135
let X = [[1], [2]]
@@ -158,7 +161,7 @@ Turns into
158161

159162
```js
160163
import * as tf from '@tensorflow/tfjs-node'
161-
import { LinearRegression, setBackend } from 'scikitjs'
164+
import { setBackend, LinearRegression } from 'scikitjs'
162165
setBackend(tf)
163166

164167
let X = [[1], [2]]
@@ -195,7 +198,7 @@ Turns into
195198

196199
```js
197200
import * as tf from '@tensorflow/tfjs-node'
198-
import { LogisticRegression, setBackend } from 'scikitjs'
201+
import { setBackend, LogisticRegression } from 'scikitjs'
199202
setBackend(tf)
200203

201204
let X = [[1], [-1]]

0 commit comments

Comments
 (0)