Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Stateful LSTM #67

Merged
merged 10 commits into from
Nov 5, 2018
Merged

Stateful LSTM #67

merged 10 commits into from
Nov 5, 2018

Conversation

memo
Copy link
Contributor

@memo memo commented Oct 7, 2018

updates to the LSTM examples to make compatible with the PR for stateful LSTM. Also, an example for stateful LSTM.

@memo memo changed the title Lstm update Stateful Lstm update Oct 7, 2018
@memo memo changed the title Stateful Lstm update Stateful LSTM Oct 7, 2018
Copy link
Member

@cvalenzuela cvalenzuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super clear! Maybe @shiffman has more inputs for the examples? Is there a more friendly version of slicing a string in p5? (generate(currentText.slice(-1), true);)


// start autogenerating
function onStartButton() {
if(currentText == '') generateWithFullInputText();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a style comment: we writing if/else statements with { } instead of inline.

// Generate new text
function generate(seed, stateful) {
// prevent starting inference if we've already started another instance
// TODO: is there better JS way of doing this?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also handle this from the src. Adding await tf.nextFrame(); in generateInternal() will wait for tf before computing another pass

@cvalenzuela cvalenzuela merged commit d774387 into ml5js:master Nov 5, 2018
joeyklee pushed a commit that referenced this pull request Nov 7, 2019
* first example to test lstm updates

* add runningInference check to LSTM examples to avoid running model simultaneously multiple times

* added basic working Stateful LSTM example

* remove LSTM Text Mixer example

* fix LSTM stateful example if else code style

* LSTM stateful example visualises probability distributions

* adding new model and feaute extractor example

* updates to new api
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants