def __init__(self, config): super(Model, self).__init__(config=config) self.convolutional_encoder = get_component("convolutional_encoder", config) self.variational_encoder = get_component("variational_encoder", config) self.state_transition_model = get_component("state_transition_model", config) self.weights = self.get_weights_dict()
def __init__(self, config): super(Model, self).__init__(config=config) self.convolutional_encoder = get_component("convolutional_encoder", config) self.state_transition_model = get_component( "stochastic_state_transition_model", config) self.convolutional_decoder = get_component( "stochastic_convolutional_decoder", config) self.prior_model = get_component("prior_model", config) self.posterior_model = get_component("posterior_model", config) self.use_consistency_model = False if (self.config.model.imagination_model.consistency_model.alpha != 0.0): self.use_consistency_model = True _consistency_model_name = self.config.model.imagination_model.consistency_model.name self.is_consistency_model_euclidean = False if _consistency_model_name == "euclidean": self.is_consistency_model_euclidean = True self.consistency_model = get_component( "consistency_model.{}".format(_consistency_model_name), config) self.use_imitation_learning_model = False if self.config.model.imagination_model.imitation_learning_model.should_train: self.use_imitation_learning_model = True if (self.use_imitation_learning_model): self.imitation_learning_model = get_component( "imitation_learning_model.{}".format( self.config.model.imagination_model. imitation_learning_model.name), config)