A javaScript port of https://github.com/karpathy/char-rnn
npm install char-rnn
const CharRnn = require("./char-rnn");
const Memory = require("./memory");
const Linalg = require("./linalg");
const Lstm = require("./lstm");
const networkMemory = new Memory(buffer: a Buffer, metadata: a json representation of the buffer);
const linalg = new Linalg(networkMemory);
const params = {affines, nNodes, nLayers, vocab, ivocab}
// ^^^ there are more steps here. see load.js file for more information.
const model = new LSTM(linalg, params);
const myNetwork = new CharRNN(model)
The CharRNN constructor. Instantiates an object that represents the neural network.
Parameters
model
LSTM is aliased by model.
Gets the network state. Calls LSTM.prototype.makeState or LSTM.prototype.copyState, which returns a Vector.
Parameters
str
initialState
A prototype method, CharRnn#score
Parameters
str
initialState
A prototype method, CharRnn#sample
Parameters
state
Vector is instantiated using a Float32Array.
Object to perform Linear Algebra
Parameters
memory
Memory object.
takes a dat and json file with the same filename, and returns an instance of the CharRnn Model.
Parameters
Returns CharRnn [description]
Returns an LSTM Object. See documentation. More about long short-term memory on Wikipedia.
Parameters
Returns Object
Memory Object
Parameters