| 995 | |
| 996 | @torch.no_grad() |
| 997 | def conditional_sample(self, data_batch, horizon=None, num_samp=1, class_free_guide_w=0.0, **kwargs): |
| 998 | batch_size = data_batch['history_positions'].size()[0] |
| 999 | horizon = horizon or self.horizon |
| 1000 | shape = (batch_size, num_samp, horizon, self.transition_dim) |
| 1001 | |
| 1002 | return self.p_sample_loop(shape, data_batch, num_samp, class_free_guide_w=class_free_guide_w, **kwargs) |
| 1003 | |
| 1004 | #------------------------------------------ training ------------------------------------------# |
| 1005 | |