SketchRNN
constructor.
Path to the checkpoint directory.
Given the RNN state, returns the probabilty distribution function (pdf) of the next stroke. Optionally adjust the temperature of the pdf here.
previous LSTMState.
(Optional) for dx and dy (default 0.65)
(Optional) for Pi and Pen discrete states (default is temperature * 0.5 + 0.5, which is a nice heuristic.)
StrokePDF (pi, muX, muY, sigmaX, sigmaY, corr, pen)
Loads variables from the JSON model
Returns true if model is intialized.
Convert from a line format to stroke-5
list of points [[x0, y0], [x1, y1], ...]
the absolute position of the last point
stroke-5 format of the line, list of [dx, dy, p0, p1, p2]
Convert from polylines to stroke-5 format that sketch-rnn uses
list of points each elem is ([[x0, y0], [x1, y1], ...])
stroke-5 format of the line, list of [dx, dy, p0, p1, p2]
Samples the next point of the sketch given pdf parameters
result from getPDF() call
Sets the internal EXTRA factor of this model (pixel to model space)
(the extra scale factor for pixel to model space)
nothing
Simplifies line using RDP algorithm
list of points [[x0, y0], [x1, y1], ...]
(Optional) default 2.0
simpified line [[x0', y0'], [x1', y1'], ...]
Simplifies lines using RDP algorithm
(Optional) default 2.0
simpified lines (each elem is [[x0', y0'], [x1', y1'], ...])
Updates the RNN on a series of Strokes, returns the next state.
list of [dx, dy, penDown, penUp, penEnd].
previous LSTMState.
(Optional) number of steps of the stroke to update (default is length of strokes list)
the final LSTMState.
Returns the zero input state of the model
.
Returns the zero/initial state of the model
zero state of the lstm: [c, h], where c and h are zero vectors.
Generated using TypeDoc
Main SketchRNN model class.
Implementation of decoder model in https://arxiv.org/abs/1704.03477
TODO(hardmaru): make a "batch" continueSequence-like method that runs fully on GPU.