ujh / iomrascalai

Iomrascálaí is an AI for the game of Go/Weiqi/Baduk written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate the DCNN idea

ujh opened this issue · comments

There's some free DCNN data out there. Maybe it's worthwhile to try to integrate it into the bot. Especially as a new prior once the prior calculation has been move into a separate thread (issue #233).

Even though there are caffe bindings for Rust it seems that installing caffe is quite a big issue. It seems that the better solution would be to convert the trained DCNN to Tensorflow file format (see also here).

commented

But how to use Tensorflow? Are there Rust bindings for that? I got caffe to compile on my VM

Both solutions aren't ideal. If it were up to me I'd have a solution that doesn't require an external library. To be honest though, I haven't checked either solution yet. I assume if we do either we loose the statically linked binaries and Windows support will probably be even worse. 👎

commented

It's not really worse, it's just "feature not supported on Windows"

considering it's not supported on Windows OR Linux right now it would be an improvement to implement it

Ha! That's a way to look at it. 😁

I don't even know how that would work though. But it's something to figure out. I mean, ideally the executable would check at runtime if it can load the library (e.g. Caffe) and then either turn on that feature or not. This way we could keep the prebuilt executables. Otherwise we would need to use some kind of conditional compilation. I assume that exists in Rust too.

commented

There are bindings for tensorflow to Rust ( https://github.com/ajtulloch/tensorflow-rs ) but there are no binaries for Tensorflow for Windows either.

Now with Google entering the game I think it's finally time to seriously investigate this.

  1. Figure out if it's possible to statically link the caffe library. That way we have at least standalone binaries.
  2. Only build in this feature for platforms that are actually supported by Caffe.

Maybe it would be worthwhile to investigate Leaf and see if we can't use that instead.

commented

investigated, not usable until they have a serialization format (which they'll have eventually)

Thanks. Maybe they'll have one once we get around to actually implementing this. 😝

I just tried to build caffe.rs and I gave up after a while, so that seems to be out. And as you said, the serialisation and deserialisation of Leaf isn't complete yet. On top of that it requires you to install capnp which also isn't ideal as I'd prefer a solution with zero dependencies. I'll try to build tensorflow.rs and see how that goes. At least I'll know how to use a DCNN now and maybe I can switch to leaf when it's ready.

https://github.com/google/tensorflow-rust doesn't work on OSX. I'll try the other library next.

commented

I built caffe.rs just fine on Linux. I just need to figure out how to use it, though.

That's a good point! I have a Linux VM running here so I could give that a go. It's a technology preview only anyway.

Am 09.06.2016 um 18:04 schrieb iopq notifications@github.com:

I built caffe.rs just fine on Linux. I just need to figure out how to use it, though.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Now that leaf is dead I'm back to yet another idea. As I don't want caffe, torch, or tensorflow as a dependency I've been thinking of the following:

What if we train the DCNN on some of the existing tools and then convert it to Rust? Implementing the NN parts we need in Rust isn't a small effort but certainly doable. Then we have the power of those tools available for training but we would still end up with a bot with zero dependencies. And as a side effect I would understand those NNs in detail. 😁

Anyway, that's all just wishful thinking for now. I'll see what I can come up with in terms of small and doable partial steps.

It turns out that compiling caffe.rs isn't that hard after all.

tensorflow-rust is now also working on OSX. I think we're getting there. Although in the end it would still like to have a NN library written purely in Rust to run the net so that I don't have to have dependencies on third party software to be installed.

I will put this back into the backlog for now. It's a big undertaking that I will eventually tackle but not now.