Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DRLAgent' object has no attribute 'train_A2C' #82

Closed
jxin2618 opened this issue Jan 25, 2021 · 2 comments
Closed

'DRLAgent' object has no attribute 'train_A2C' #82

jxin2618 opened this issue Jan 25, 2021 · 2 comments

Comments

@jxin2618
Copy link

class DRLAgent:
"""Provides implementations for DRL algorithms

Attributes
----------
    env: gym environment class
        user-defined class

Methods
-------
train_PPO()
    the implementation for PPO algorithm
train_A2C()
    the implementation for A2C algorithm
train_DDPG()
    the implementation for DDPG algorithm
train_TD3()
    the implementation for TD3 algorithm
train_SAC()
    the implementation for SAC algorithm
DRL_prediction()
    make a prediction in a test dataset and get results
"""

There does not exist the method train_A2C() under the class DRLAgent. Can you help to fix it?

@spencerR1992
Copy link
Contributor

Hi! We have made a few changes to the DRLAgent class which allow the future implementation of more functionality aside from the enumerated algorithms. In order to clean up the implementation we have made changes, and demonstrated loading various models in the notebooks in notebook, (specifically the multistock notebook!) The new implementation is quite easy to read, and we think you'll like it!

@Mostafasaeed29
Copy link

env_train = env_setup.create_env_training(data = Train_df,
env_class = StockPortfolioEnv)
agent = DRLAgent(env = env_train)

print("==============Model Training===========")
now = datetime.datetime.now().strftime('%Y%m%d-%Hh%M')
a2c_params_tuning = {'n_steps':5,
'ent_coef':0.005,
'learning_rate':0.0003,
'verbose':0,
'timesteps':50000}
model_a2c = agent.train_A2C(model_name = "A2C_{}".format(now), model_params = a2c_params_tuning)

It is giving me :
'DRLAgent' object has no attribute 'train_A2C'
So can you help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants