question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Network.fromJSON / .toJSON is incomplete

See original GitHub issue

Description

In theory, Network.fromJSON(Network.toJSON()) should produce a deep copy of a network but as noted in #149 this is not the case. It seems that the import / export does not currently involve all of details necessary to achieve this.

Screenshots

Network Import Export Bug

Dropout is a top level parameter that is not included in the import / export system and should

Files

Network.js

Extra considerations

We should specifically consider making this import / export system compatible with other more popular libraries like Tensorflow for maximum interoperability

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
christianechevarriacommented, Dec 17, 2019

@tracycollins @raimannma and I were having issues reproducing, would you be able to tell us what version you’re running and what the code looks like to have a better idea what’s going on?

Looks like the problem I was having was due to my using both carrot and neataptic libraries, and trying to erroneously convert networks between the two. This was a bug in my code.

Although this does not seem to be possible now, might this be possible (and useful) in the future? And not just between carrot and neataptic, but between other libraries as well? Is there anything like a generic/standard JSON format for networks?

@teh-mICON and I were just discussing this in the context of building a generic neural-network visualization library that is inter-operable with all JS neural-network libraries, but as far as I’m aware there’s no standard to date for JS specifically – which is a big bummer lol.

There is ONNX though, which is popular in python and was already requested by @loaiabdalslam on #159, but to be honest I’m not sure on how to begin working on this one, but I’m sure there’s someone in the open source community who would – just not sure who they are yet.

Another idea that could work is potentially replicating a system like ONNX in JS and maybe making it inter-operable with python modes in the future as our community’s knowledge increases or new tech is developed (this is something that should be added to the discussion in #178 since WASM could be a huge resource for getting it done across libraries and languages).

As far as getting a standard adopted, there’s an ML group in JS called BRIIM which includes Brain.js and Neataptic which might be a good place to start proposing an idea like this. It seems like both were spearheaded by @rwieruch so maybe we can start by approaching him

2reactions
raimannmacommented, Dec 9, 2019

I almost had the same issue it’s a quick change in one toJSON() method, where the JSON keys are different between toJSON and fromJSON.

I fixed it just for me and didn’t created a PR. 😦

When I’m home I can create the PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Read JSON with QJsonObject - qt - Stack Overflow
cpp:53: error: variable 'QJsonObject valuesO' has initializer but incomplete type QJsonObject valuesO = document.object(); C:\Qt\Tools\QtCreator ...
Read more >
Data.Aeson - Hackage
This module contains instances of ToJSON and FromJSON for types from the time library. Those instances encode time as JSON strings in ISO...
Read more >
Step-by-Step guide for Flutter JSON Serialization - ITNEXT
I published some time ago a video tutorial on how we can create a basic network request. In this post, we want to...
Read more >
Using FromJson() when the type is not known ahead of time
Deserialize the JSON into a class or struct that contains 'common' fields, and then use the values of those fields to work out...
Read more >
RJSONIO.pdf
Title Serialize R Objects to JSON, JavaScript Object Notation ... fromJSON. Convert JSON content to R objects. Description.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found