Skip to content

Instantly share code, notes, and snippets.

@vmalyi
Last active November 12, 2017 19:33
Show Gist options
  • Save vmalyi/0c8b9cc7d7dd53331e14c937f2d4bebc to your computer and use it in GitHub Desktop.
Save vmalyi/0c8b9cc7d7dd53331e14c937f2d4bebc to your computer and use it in GitHub Desktop.

Revisions

  1. vmalyi revised this gist Nov 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Run or Walk (Part 4) - Saving the model
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ...
    model.fit(X, Y, epochs=NUMBER_OF_EPOCHS, batch_size=BATCH_SIZE)

    ...
    # serialize model to JSON
    model_json = model.to_json()
    # save JSON to the disk
  2. vmalyi revised this gist Nov 12, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Run or Walk (Part 4) - Saving the model
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    ...
    model.fit(X, Y, epochs=NUMBER_OF_EPOCHS, batch_size=BATCH_SIZE)

    # serialize model to JSON
    model_json = model.to_json()
    # save JSON to the disk
    with open("saved_model.json", "w") as json_file:
    json_file.write(model_json)
  3. vmalyi renamed this gist Nov 12, 2017. 1 changed file with 3 additions and 4 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    ...
    ...
    model.fit(X, Y, epochs=NUMBER_OF_EPOCHS, batch_size=BATCH_SIZE)


    model_json = model.to_json()
    with open("model.json", "w") as json_file:
    json_file.write(model_json)
    with open("saved_model.json", "w") as json_file:
    json_file.write(model_json)
  4. vmalyi created this gist Nov 12, 2017.
    7 changes: 7 additions & 0 deletions Run or Walk (Part 4) - Serialize model
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    ...
    model.fit(X, Y, epochs=NUMBER_OF_EPOCHS, batch_size=BATCH_SIZE)


    model_json = model.to_json()
    with open("model.json", "w") as json_file:
    json_file.write(model_json)