(outputs)
| 170 | Launch forward prediction for the new state given by some client. |
| 171 | """ |
| 172 | def cb(outputs): |
| 173 | try: |
| 174 | distrib, value = outputs.result() |
| 175 | except CancelledError: |
| 176 | logger.info("Client {} cancelled.".format(client.ident.decode('utf-8'))) |
| 177 | return |
| 178 | assert np.all(np.isfinite(distrib)), distrib |
| 179 | action = np.random.choice(len(distrib), p=distrib) |
| 180 | client.memory.append(TransitionExperience( |
| 181 | state, action, reward=None, value=value, prob=distrib[action])) |
| 182 | self.send_queue.put([client.ident, dumps(action)]) |
| 183 | self.async_predictor.put_task([state], cb) |
| 184 | |
| 185 | def _process_msg(self, client, state, reward, isOver): |
nothing calls this directly
no test coverage detected