Sac update
mighty.mighty_update.sac_update
#
SACUpdate
#
SACUpdate(
model: SACModel,
policy_lr: float = 0.001,
q_lr: float = 0.001,
value_lr: float = 0.001,
tau: float = 0.005,
alpha: float = 0.2,
gamma: float = 0.99,
)
:param model: The SAC model containing policy and Q-networks. :param policy_lr: Learning rate for the policy network. :param q_lr: Learning rate for the Q-networks. :param value_lr: Learning rate for the value network. :param tau: Soft update parameter for the target networks. :param alpha: Entropy regularization coefficient.
Source code in mighty/mighty_update/sac_update.py
calculate_td_error
#
calculate_td_error(transition: TransitionBatch) -> Tuple
Calculate the TD error for a given transition.
:param transition: Current transition :return: TD error
Source code in mighty/mighty_update/sac_update.py
update
#
update(batch: TransitionBatch) -> Dict
Perform an update of the SAC model using a batch of experience.
:param batch: A batch of experience data. :return: A dictionary of loss values for tracking.
Source code in mighty/mighty_update/sac_update.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|