def __init__(self, config): super(UpdaterObj, self).__init__() self.enc_apc = EncoderBlock( channel_list=config['dec_apc_channel_rev'], kernel_list=config['dec_apc_kernel_rev'], stride_list=config['dec_apc_stride_rev'], hidden_list=config['dec_apc_hidden_rev'], in_shape=config['image_shape'], out_features=None, ) self.enc_shp = EncoderBlock( channel_list=config['dec_shp_channel_rev'], kernel_list=config['dec_shp_kernel_rev'], stride_list=config['dec_shp_stride_rev'], hidden_list=config['dec_shp_hidden_rev'], in_shape=[1, *config['image_shape'][1:]], out_features=None, ) self.lstm = nn.LSTMCell( self.enc_apc.out_features + self.enc_shp.out_features, config['state_obj_size'])
def __init__(self, config): super(UpdaterBck, self).__init__() self.enc = EncoderBlock( channel_list=config['dec_bck_channel_rev'], kernel_list=config['dec_bck_kernel_rev'], stride_list=config['dec_bck_stride_rev'], hidden_list=config['dec_bck_hidden_rev'], in_shape=config['image_shape'], out_features=None, ) self.lstm = nn.LSTMCell(self.enc.out_features, config['state_bck_size'])
def __init__(self, channel_list, kernel_list, stride_list, hidden_list, in_shape, state_size): super(EncoderLSTM, self).__init__() self.enc = EncoderBlock( channel_list=channel_list, kernel_list=kernel_list, stride_list=stride_list, hidden_list=hidden_list, in_shape=in_shape, out_features=None, ) self.lstm = nn.LSTMCell(self.enc.out_features, state_size)
def __init__(self, config): super(Updater, self).__init__() self.enc = EncoderBlock( channel_list=config['upd_channel'], kernel_list=config['upd_kernel'], stride_list=config['upd_stride'], hidden_list=config['upd_hidden'], in_shape=[ config['image_shape'][0] * 2, *config['image_shape'][1:] ], out_features=None, ) self.lstm = nn.LSTMCell(self.enc.out_features, config['state_size'])
def __init__(self, config): super(NetworkWhat, self).__init__() latent_size = config['latent_what_size'] self.register_buffer('prior_mu', torch.zeros([latent_size])) self.register_buffer('prior_logvar', torch.zeros([latent_size])) self.enc = EncoderBlock( channel_list=config['enc_what_channel'], kernel_list=config['enc_what_kernel'], stride_list=config['enc_what_stride'], hidden_list=config['enc_what_hidden'], in_shape=[config['crop_shape'][0] * 2, *config['crop_shape'][1:]], out_features=latent_size * 2, ) self.dec = DecoderBlock( channel_list_rev=config['dec_what_channel_rev'], kernel_list_rev=config['dec_what_kernel_rev'], stride_list_rev=config['dec_what_stride_rev'], hidden_list_rev=config['dec_what_hidden_rev'], in_features=latent_size, out_shape=config['crop_shape'], )
def __init__(self, config): super(NetworkBack, self).__init__() latent_size = config['latent_back_size'] self.register_buffer('prior_mu', torch.zeros([latent_size])) self.register_buffer('prior_logvar', torch.zeros([latent_size])) self.enc = EncoderBlock( channel_list=config['enc_back_channel'], kernel_list=config['enc_back_kernel'], stride_list=config['enc_back_stride'], hidden_list=config['enc_back_hidden'], in_shape=config['image_shape'], out_features=latent_size * 2, ) self.dec = DecoderResidual( avg_hidden_list_rev=config['dec_back_avg_hidden_rev'], res_channel_list_rev=config['dec_back_res_channel_rev'], res_kernel_list_rev=config['dec_back_res_kernel_rev'], res_stride_list_rev=config['dec_back_res_stride_rev'], res_hidden_list_rev=config['dec_back_res_hidden_rev'], in_features=latent_size, image_shape=config['image_shape'], )