Add 3 files
Browse files- README.md +58 -0
- model/model.json +1 -0
- model/weights.bin +3 -0
README.md
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# TensorFlow.js Model
|
2 |
+
|
3 |
+
## Model Information
|
4 |
+
- Framework: TensorFlow.js
|
5 |
+
- Type: Deep Q-Network (DQN)
|
6 |
+
- Created by: IgnitionAI
|
7 |
+
|
8 |
+
## Model Format
|
9 |
+
This model is saved in TensorFlow.js format and can be loaded in two ways:
|
10 |
+
|
11 |
+
1. **LayersModel** (Default)
|
12 |
+
- Better for fine-tuning and training
|
13 |
+
- More flexible for model modifications
|
14 |
+
- Higher memory usage
|
15 |
+
- Slower inference
|
16 |
+
|
17 |
+
2. **GraphModel**
|
18 |
+
- Optimized for inference only
|
19 |
+
- Faster execution
|
20 |
+
- Lower memory usage
|
21 |
+
- Not suitable for training
|
22 |
+
|
23 |
+
## Usage
|
24 |
+
```javascript
|
25 |
+
import { loadModelFromHub } from '@ignitionai/backend-tfjs';
|
26 |
+
|
27 |
+
// Option 1: Load as LayersModel (for training/fine-tuning)
|
28 |
+
const layersModel = await loadModelFromHub(
|
29 |
+
'salim4n/tfjs-dqn-test-1744653943097',
|
30 |
+
'model/model.json',
|
31 |
+
false // graphModel = false for LayersModel
|
32 |
+
);
|
33 |
+
|
34 |
+
// Option 2: Load as GraphModel (for inference only)
|
35 |
+
const graphModel = await loadModelFromHub(
|
36 |
+
'salim4n/tfjs-dqn-test-1744653943097',
|
37 |
+
'model/model.json',
|
38 |
+
true // graphModel = true for GraphModel
|
39 |
+
);
|
40 |
+
|
41 |
+
// Run inference
|
42 |
+
const input = tf.tensor2d([[0.1, 0.2]]);
|
43 |
+
const output = model.predict(input);
|
44 |
+
```
|
45 |
+
|
46 |
+
## Features
|
47 |
+
- Automatic retry with exponential backoff
|
48 |
+
- Configurable retry attempts and delays
|
49 |
+
- Error handling and logging
|
50 |
+
- Support for both LayersModel and GraphModel
|
51 |
+
|
52 |
+
## Files
|
53 |
+
- `model.json`: Model architecture and configuration
|
54 |
+
- `weights.bin`: Model weights
|
55 |
+
- `README.md`: This documentation
|
56 |
+
|
57 |
+
## Repository
|
58 |
+
This model was uploaded via the IgnitionAI TensorFlow.js integration.
|
model/model.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
"{\"class_name\":\"Sequential\",\"config\":{\"name\":\"sequential_1\",\"layers\":[{\"class_name\":\"Dense\",\"config\":{\"units\":8,\"activation\":\"relu\",\"use_bias\":true,\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"scale\":1,\"mode\":\"fan_avg\",\"distribution\":\"normal\",\"seed\":null}},\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}},\"kernel_regularizer\":null,\"bias_regularizer\":null,\"activity_regularizer\":null,\"kernel_constraint\":null,\"bias_constraint\":null,\"name\":\"dense_Dense1\",\"trainable\":true,\"batch_input_shape\":[null,2],\"dtype\":\"float32\"}},{\"class_name\":\"Dense\",\"config\":{\"units\":2,\"activation\":\"linear\",\"use_bias\":true,\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"scale\":1,\"mode\":\"fan_avg\",\"distribution\":\"normal\",\"seed\":null}},\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}},\"kernel_regularizer\":null,\"bias_regularizer\":null,\"activity_regularizer\":null,\"kernel_constraint\":null,\"bias_constraint\":null,\"name\":\"dense_Dense2\",\"trainable\":true}}]},\"keras_version\":\"tfjs-layers 4.22.0\",\"backend\":\"tensor_flow.js\"}"
|
model/weights.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e60874375a0c8e64dd8fecdaac678d1cf2ba733c93c5890e9922ec60a57ee32
|
3 |
+
size 168
|