16 August 2023 0 3K Report

``` def create_actor(self, num_action): state_input = keras.Input(shape=[self.env.num_state]) h1 = keras.layers.Dense(500, activation='relu')(state_input) h2 = keras.layers.Dense(1000, activation='relu')(h1) h3 = keras.layers.Dense(500, activation='relu')(h2) output = keras.layers.Dense(num_action, activation='softmax')(h3) actor = keras.Model(inputs=state_input, outputs=output) return actor def create_critic(self): state_input = keras.Input(shape=[self.env.num_state]) h1 = keras.layers.Dense(500, activation='relu')(state_input) h2 = keras.layers.Dense(1000, activation='relu')(h1) h3 = keras.layers.Dense(500, activation='relu')(h2) output = keras.layers.Dense(1, activation=None)(h3) critic = keras.Model(inputs=state_input, outputs=output) return critic ``` let's say the state i'm expecting to pass to actor network from custom env is just [0. 0. 0. 0. 0.]. but i am getting this: [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.]. Why I'm getting extra dimension of state? Was it because I created actor and critic network incorrectly? How do i fix this?

More Swe Zin's questions See All
Similar questions and discussions