in the below given code i am getting the follwoing error please rectify the error…
- User
in the below given code i am getting the follwoing error please rectify the error WARNING:tensorflow:Gradients do not exist for variables ['actor_critic/dense_2/kernel:0', 'actor_critic/dense_2/bias:0'] when minimizing the loss. If you're using
model.compile(), did you forget to provide alossargument? WARNING:tensorflow:Gradients do not exist for variables ['actor_critic/dense_2/kernel:0', 'actor_critic/dense_2/bias:0'] when minimizing the loss. If you're usingmodel.compile(), did you forget to provide alossargument?Define the neural network architecture for the actor and critic
class ActorCritic(tf.keras.Model): def init(self, n_actions): super(ActorCritic, self).init() self.dense1 = Dense(64, activation='relu') self.policy = Dense(n_actions, activation='softmax') self.value = Dense(1, activation=None)
codedef call(self, state): x = self.dense1(state) policy = self.policy(x) value = self.value(x) return policy, valuePPO Agent
class PPOAgent: def init(self, input_dims, alpha=0.0003, beta=0.0003, gamma=0.99, n_actions=13): self.actor_critic = ActorCritic(n_actions) self.actor_critic.compile(optimizer=Adam(learning_rate=alpha)) self.gamma = gamma self.n_actions = n_actions self.action_space = np.arange(n_actions)
code - Assistant
- User
can you able to provide me the updated code from your suggession
- Assistant
- User
- RL Action Space, The action vector varies for different types of components because the parameters needed to search are not the same. We use a continuous action space to determine the transistor sizes even though we will round them to discrete values. The reason why we do not use a discrete action space is because that will lose the relative order information, also because the discrete action space is too large.
- RL Action Representation, fine-grained tuning steps to find optimal device parameters, the round off discrete values from its continuous action space, to tune input design device parameter values. For each tunable parameter 𝑥 "['L1', 'L3', 'L5', 'L6', 'L7', 'W1', 'W3', 'W5', 'W6', 'W7', 'Io', 'CP', 'VC'] " of a device, there are three possible actions at each step: increasing (𝑥+del 𝑥), keeping (𝑥 +0), or decreasing (𝑥−del 𝑥) the parameter, where “del 𝑥" is the smallest unit to update the parameter within its bound [𝑥min, 𝑥max], Bounds = {'L1': (0.18e-6, 1e-6), 'L3': (0.18e-6, 1e-6), 'L5': (0.18e-6, 1e-6), 'L6': (0.18e-6, 1e-6), 'L7': (0.18e-6, 1e-6), 'W1': (1e-6, 12e-6), 'W3': (2.52e-6, 28e-6), 'W5': (2.16e-6, 24e-6), 'W6': (32e-6, 100e-6), 'W7': (13.5e-6, 100e-6), 'Io': (15e-6, 30e-6), 'CP': (0.44e-12, 3e-12), 'VC': (0.8, 1.5)}. Total 13 device parameters, the output of the policy network is an 13 × 3 probability distribution matrix with each row corresponding to a parameter. The action is taken based on the probability distribution.
- Assistant