Giter Club home page Giter Club logo

Comments (2)

lerrytang avatar lerrytang commented on August 23, 2024

Hi,

Thanks for using evojax and the question.
Evojax has no knowledge of the differentiability of the policy network, it simply optimizes what is given.
While I'm not very certain about your usage, the following method may help.

# Only ask the solver for the parameters that belong to the non-diff operations.
solver = NeuroEvolutionAlgo(param_size=non_diff_param_size)

# Define the policy to contain both diff and non-diff operations.
class AwesomePolicy:

   def __init__(self):
       # policy network definition and init
       # Save the part that are differentiable.
       self.diff_params = xxxxx

  def reset():
      # Save the differentiable params in the policy state.
      return PolicyState(params=self.diff_params)

   def get_action(self, params, p_state):
       # The "params" parameter is coming from the solver, they belong to the non-diff ops.
        load_diff_params_to_model(p_state.params)
        load_non_diff_params(params)
        # Model inference

Let me know if that works or when you have further questions.

from evojax.

jakubMitura14 avatar jakubMitura14 commented on August 23, 2024

Thank you! I will experiment on this, and not to clutter your issues close for now, in case of further problems will reopen.
And once more time thanks for publishing this fantastic work !!

from evojax.

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.