Skip to content

Extracting learned parameters from a QLearning instance #1861

Closed

Description

@cascala

Hey folks,

How does one extract the learned parameters from a QLearning instance?

The obvious things don't seem to help me:

  • The learningNetwork variable in q_learning.hpp is private...
  • and there is no accessor function either

Is there a public member function that I can use?

Thank you!

Activity

  1. zoq commented on Apr 14, 2019

    @zoq
    Member

    Good point, I think providing a function to access the learned network should solve the issue. I can open a PR, unless you already have something ready?

  2. cascala commented on Apr 14, 2019

    @cascala
    ContributorAuthor

    @zoq
    Let me have a look; I will send over a pull request later this week.

    Is there any other agent that already does this (so I can mimic the same code and naming style)?

    If not, would you prefer that I add an accessor to the parameters only (return type arma::mat), or a copy of the entire trained model (with layers etc.) (return type NetworkType).

  3. zoq commented on Apr 14, 2019

    @zoq
    Member

    I would go with the a getter/setter for the complete network, afterwards a user could do LearningNetwork().Parameters() to e.g. get the learned parameter. Here is an example:

    //! Return the generator of the GAN.
    const Model& Generator() const { return generator; }
    //! Modify the generator of the GAN.
    Model& Generator() { return generator; }

    Let me know what you think.

  4. cascala commented on Apr 16, 2019

    @cascala
    ContributorAuthor

    Addressed in pull request #1865

  5. rcurtin commented on Apr 16, 2019

    @rcurtin
    Member

    Let's not close the issue until the fix is merged.

  6. zoq commented on Apr 18, 2019

    @zoq
    Member

    Fixed in #1865.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions