https://github.com/cawfree/tfjs-clone
👬 Creates a deep clone of an existing @tensorflow/tfjs model.
https://github.com/cawfree/tfjs-clone
clone copy duplicate learning machine networks neural tensorflow tfjs
Last synced: 2 months ago
JSON representation
👬 Creates a deep clone of an existing @tensorflow/tfjs model.
- Host: GitHub
- URL: https://github.com/cawfree/tfjs-clone
- Owner: cawfree
- License: mit
- Created: 2020-01-18T22:59:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-18T23:41:19.000Z (over 6 years ago)
- Last Synced: 2025-10-05T16:42:27.290Z (9 months ago)
- Topics: clone, copy, duplicate, learning, machine, networks, neural, tensorflow, tfjs
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tfjs-clone
Creates a deep clone of an existing @tensorflow/tfjs model.
## 🚀 Getting Started
Using [`npm`]():
```bash
npm install --save tfjs-clone
```
Using [`yarn`]():
```bash
yarn add tfjs-clone
```
## ✍️ Usage
```javascript
import * as tf from '@tensorflow/tfjs';
import { model as clone } from 'tfjs-clone';
const m = tf.sequential();
m.add(tf.layers.dense({ inputShape: [1], units: 16, activation: 'relu' }));
m.add(tf.layers.dense({ units: 1, activation: 'sigmoid' }));
m.compile({ optimizer: tf.train.rmsprop(1e-2), loss: 'binaryCrossentropy' });
const m2 = await clone(m);
```
## ✌️ License
[MIT](https://opensource.org/licenses/MIT)