tfjs-clone

0.0.1 • Public • Published

tfjs-clone

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

code style: prettier

🚀 Getting Started

Using npm:

npm install --save tfjs-clone

Using yarn:

yarn add tfjs-clone

✍️ Usage

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

Package Sidebar

Install

npm i tfjs-clone

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

4.56 kB

Total Files

7

Last publish

Collaborators

  • cawfree