ttw/models/continuous.py [49:67]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return out

    def save(self, path):
        state = dict()
        state['vocab_sz'] = self.vocab_sz
        state['num_observations'] = self.num_observations
        state['num_actions'] = self.num_actions
        state['T'] = self.T
        state['apply_masc'] = self.apply_masc
        state['parameters'] = self.state_dict()
        torch.save(state, path)

    @classmethod
    def load(cls, path):
        state = torch.load(path)
        tourist = cls(state['vocab_sz'], state['num_observations'], state['num_actions'],
                      T=state['T'], apply_masc=state['apply_masc'])
        tourist.load_state_dict(state['parameters'])
        return tourist
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ttw/models/discrete.py [83:101]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return out

    def save(self, path):
        state = dict()
        state['vocab_sz'] = self.vocab_sz
        state['num_observations'] = self.num_observations
        state['num_actions'] = self.num_actions
        state['T'] = self.T
        state['apply_masc'] = self.apply_masc
        state['parameters'] = self.state_dict()
        torch.save(state, path)

    @classmethod
    def load(cls, path):
        state = torch.load(path)
        tourist = cls(state['vocab_sz'], state['num_observations'], state['num_actions'],
                      T=state['T'], apply_masc=state['apply_masc'])
        tourist.load_state_dict(state['parameters'])
        return tourist
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



