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.

This is somewhat of an elevator pitch referring to the profit meme in
My proposal for the ???? part is to consider Fable integration as a possible driver for that.


When I was learning neural networks a few years ago, I remember playing a lot with Andrej Karpathy’s deep-learning library in Javascript.

The main reason why I actually spent time playing with slow Javascript backpropagation rather than training neural networks in Python on real Nvidia GPU are a) it’s a great learning and teaching tool, b) it’s extremely accessible (all you need is browser, no install necessary), c) and most importantly, it’s interactive and extremely involving.

Another argument effective just recently is that the GPUs are nowadays accessible also in browsers through WebGL.

By far the coolest thing is that in browser the state of neural network can easily be visualized in real time, which makes it very addictive: you change some parameters, choose what to visualize, press Run and see the effects of your changes as things progress… Then rinse and repeat. It’s easy to spend heaps of time having fun with that.

Scroll down for some images…

Rendering such images takes quite some effort in Python and you still don’t seem them as things progress, whereas on browser, all of this is accessible through a few lines of code. You can easily pick any layer of neural network to visualize. In real time.

While JS frameworks like tensorflow.js do exist, F# has unique position to target both browser and backend with the same language (Tensorflow has different implementations for Python and JS). Anything you learn or write in browser is transferable to backend.
And vice versa. Models trained in backend are easily transferable to frontend, which also makes it a good business proposition. And you squint and it looks like python.

So the idea is to use one of JS WebGL tensor libraries as an additional DiffSharp Backend. I don’t think that would be hard to do (I’d be willing to invest time into it).

The bigger obstacle is that Fable is lacking support for multidimensional arrays. I’ve tried to look into that already, but it will require someone with more knowledge on Fable-compiler internals to work on that.

So what’s really missing is to find a way to somehow invite Fable people into this story and ask them to help us out with multidimensional arrays.


These are sample images: This is what you don’t get to see in real time, if you train your networks in Python.

160727_1340_explore gray_del11_492x490 slower40


Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

dsymecommented, Jun 3, 2020

Some technical notes regarding Fable.

  1. Fable or WebSharper cross-compile would be somewhat intrusive - both in the code and in the testing.

  2. Because of this, the best approach technically would probably be for someone to maintain a downstream fork or branch (it doesn’t much matter which) which cross-compiles the Reference implementation and testing, with the Torch backend removed (a “haircut”), under the full knowledge that there will be considerable churn in the core implementation.

  3. That’s the way that the Fable port of FSharp.Compiler.Service was created and is maintained at the moment, and indeed FCS was itself created as a fork+haircut of the core F# tooling.

  4. This can be an effective maintenance strategy but requires regular integration, e.g. this. It’s sometimes possible to automate this integration

  5. Normally it’s not realistic to integrate the necessary changes back even under #if because of the engineering complexity induced at this stage.

  6. @gbaydin and myself aren’t at the point where we could do this but if @pkese or someone else would like to work on it (as a downstream fork+haircut) I’m sure we can cooperate in a similar way to happened for FCS

gbaydincommented, Jun 3, 2020

The real difficult part is the missing multidimensional array implementation in Fable compiler which I’m not sure how to approach. I’ll try to ask Fable people if they could to offer some help.

Perhaps you wouldn’t need a multidimensional array implementation in Fable, if they already support 1d arrays. DiffSharp reference backend implements multidimensional arrays (tensors) using simple arrays (like a 1d data array and a 1d shape array). The code does use some 2d arrays in parts like slicing however.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fable (2004 video game)
A port of the game for Mac OS X, created by Robosoft Technologies and published by Feral Interactive, was released in March 2008...
Read more >
Fable Steam port : r/Fable
Is anyone else really disappointed by the Fable Steam port? It doesn't support an Xbox controller plugin, it looks bad, is choppy, ...
Read more >
Fable 2 and 3 PC ports and Fixed Port
I am wondering is there a possibility of Fable 2 and 3 to get ported to PC and have Fable 3 get a...
Read more >
Never played the original is this worth it? Good PC port?
I highly suggest getting the original Fable: TLC (available on steam for next to nothing), as that one works and is an excellent...
Read more >
PORT FABLE 2 TO PC YOU ♥♥♥♥♥ :: Fable Anniversary ...
Fable 2 will never come to PC except through emulation get over it. Microsoft owns the IP and is fully capable of porting...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found