An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# tfjs-clone
Creates a deep clone of an existing @tensorflow/tfjs model.


code style: prettier

## 🚀 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)