Skip to content

About model configuration. #7644

Open
Open
@dxu23nc

Description

I noticed that there are two model configuration parameters: fcnet_hiddens in model_config and hiddens in the configuration of dqn.py.
I try to print the whole model (model.base_model.summary()), it shows that the "hiddens" do not show up. Why did that happen? I know this "hiddens" is used in function build_q_model dqn.py. The code is as follows:
`
import ray
from ray import tune
import functools
import pickle
import threading

from ray.rllib.agents import dqn
ray.init()
config= dqn.DEFAULT_CONFIG.copy()
config["num_workers"] = 1
config["hiddens"] = [512,128]
trainer = dqn.DQNTrainer(config=config,env="AirRaid-ram-v0")
model = trainer.get_policy().model
model.base_model.summary()
model.q_value_head.summary()
`

And the log is:
Model: "model"


Layer (type) Output Shape Param Connected to

observations (InputLayer) [(None, 128)] 0


fc_1 (Dense) (None, 256) 33024 observations[0][0]


fc_out (Dense) (None, 256) 65792 fc_1[0][0]


value_out (Dense) (None, 1) 257 fc_1[0][0]

Total params: 99,073
Trainable params: 99,073
Non-trainable params: 0


Model: "model_1"


Layer (type) Output Shape Param
model_out (InputLayer) [(None, 256)] 0


lambda (Lambda) [(None, 6), (None, 6, 1), 198022
Total params: 198,022
Trainable params: 198,022
Non-trainable params: 0


Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issue moderate in impact or severityquestionJust a question :)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions