| 135 | return action |
| 136 | |
| 137 | def maybe_save(self): |
| 138 | if ( |
| 139 | self.should_record and self.recorded_obz_count % c.FRAMES_PER_HDF5_FILE == 0 and |
| 140 | self.recorded_obz_count != 0 |
| 141 | ): |
| 142 | filename = os.path.join(self.sess_dir, '%s.hdf5' % |
| 143 | str(self.recorded_obz_count // c.FRAMES_PER_HDF5_FILE).zfill(10)) |
| 144 | save_hdf5(self.obz_recording, filename=filename) |
| 145 | log.info('Flushing output data') |
| 146 | self.obz_recording = [] |
| 147 | |
| 148 | def toggle_random_action(self): |
| 149 | """Reduce sampling error by diversifying experience""" |