Code Monkey home page Code Monkey logo

Comments (6)

Svalorzen avatar Svalorzen commented on August 24, 2024

Unfortunately I didn't really add in support for pickles yet (since I never actually used them). I could look into it though - it seems to be a little time consuming though so I'm not sure how much time it'll take.

In the meantime, you can probably just somehow convert your QFunction to some format you can save. It has a shape function so you can just loop over it and save all the values it has.

Afterwards, you can create an MDP.Matrix2D instance of the same size, and copy the saved contents into it. This you can pass into a new instance of MDP.QGreedyPolicy and it should work the same as before.

from ai-toolbox.

Svalorzen avatar Svalorzen commented on August 24, 2024

Actually, I've just added a new commit, which seems to work on my end. I've added the ability to pickle the MDP.Policy class. So you just have to create a new MDP.Policy and use it to copy your MDP.QGreedyPolicy (since that cannot be pickled directly).

Then it should just work. Let me know if you have trouble!

from ai-toolbox.

JFan2016 avatar JFan2016 commented on August 24, 2024

Do I need to rebuild? Currently I do not have g++-7 version. When I tried to install it from ppa: ubuntu-toolchain-r/test, the package could not be found.

from ai-toolbox.

Svalorzen avatar Svalorzen commented on August 24, 2024

In theory g++-6 would work but it seems it has a bug. However, clang++ seems to work fine. g++-7 at the moment is only available on Ubuntu 17.04, but as soon as a proper release is done it should definitely be backported to previous versions.

If neither upgrading OS nor using clang++ is an option for you, you can temporarily use the workaround I specified (storing your QFunction by hand and reloading it) until the g++-7 package is backported.

from ai-toolbox.

JFan2016 avatar JFan2016 commented on August 24, 2024

About the workaround, the shape of the QFunction is (6084, 4), but when I enter QFunction[6100, 20], I could still get results back. Why?

from ai-toolbox.

Svalorzen avatar Svalorzen commented on August 24, 2024

Well if you create a table bigger than what it is it's still going to be able to store the previous one. As long as you don't ask for states/actions which you have not initialized everything should be good =)

from ai-toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.