Skip to content

Commit 18d5b2f

Browse files
authored
Cleanup Baseball Node README. (#217)
1 parent a6b9605 commit 18d5b2f

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

baseball-node/README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TensorFlow.js Example: Training a baseball model in Node.js
1+
# TensorFlow.js Example: Training a baseball model in Node.js
22

33
This demo demonstrates how to train a server-side model to classify baseball pitch types using [Node.js](https://github.com/tensorflow/tfjs-node).
44

@@ -12,29 +12,39 @@ It has four parts:
1212

1313

1414
## Running the Demo
15-
First, prepare the environment and download the baseball training and test data:
15+
First, prepare the environment:
1616
```sh
17-
yarn && yarn download-data
17+
$ npm install
18+
# or
19+
$ yarn
1820
```
1921

2022
Next, start the client:
2123
```sh
22-
yarn start-client
24+
$ npm run start-client
25+
# or
26+
$ yarn start-client
2327
```
2428

2529
Open the client running at: http://localhost:8080/
2630

2731
In a new shell, start the server:
2832
```sh
29-
yarn start-server
33+
$ npm run start-server
34+
# or
35+
$ yarn start-server
3036
```
3137

32-
If you are interested in testing out the training, without running a web server:
38+
Two small scripts are provided to test training both of the baseball models without running the client/server demo:
39+
40+
* Pitch Type model:
3341
```sh
34-
yarn train-pitch-model
42+
$ node train_pitch_type.js
3543
```
44+
45+
* Strike Zone model:
3646
```sh
37-
yarn train-strike-model
47+
$ node train_strike_zone.js
3848
```
3949

4050
## Baseball Models

baseball-node/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "0.2.0",
44
"description": "Deep learning models for classifying baseball metrics",
55
"scripts": {
6-
"download-data": "./scripts/download-data.sh",
7-
"start-client": "webpack-dev-server",
6+
"start-client": "webpack && webpack-dev-server",
87
"start-server": "node server.js"
98
},
109
"license": "Apache-2.0",

0 commit comments

Comments
 (0)