(self, model, sliced_data, output)
| 141 | |
| 142 | |
| 143 | def _debug(self, model, sliced_data, output): |
| 144 | for i, item in enumerate(tqdm.tqdm(sliced_data)): |
| 145 | (_, history), = model.compute_loss([item], debug=True) |
| 146 | output.write( |
| 147 | json.dumps({ |
| 148 | 'index': i, |
| 149 | 'history': history, |
| 150 | }) + '\n') |
| 151 | output.flush() |
| 152 | |
| 153 | def _visualize_attention(self, model, beam_size, output_history, sliced_data, res1file, res2file, res3file, output): |
| 154 | res1 = json.load(open(res1file, 'r')) |