def copy_conv_weights_from(self, source): """Tie convolutional layers""" for i in range(len(self.convs)): if 'stride' not in self.convs[i].__constants__: pass else: utils.tie_weights(src=source.convs[i], trg=self.convs[i])
def copy_conv_weights_from(self, source): assert isinstance(source, DqnEncoder), \ "Source and target encoder must be the same type!" for trg_m, src_m in zip(self.convs, source.convs): if type(trg_m) == type(src_m) == nn.Conv2d: tie_weights(src=src_m, trg=trg_m)
def copy_conv_weights_from(self, source): """Tie convolutional layers""" for i in range(self.num_layers): utils.tie_weights(src=source.convs[i], trg=self.convs[i])
def copy_conv_weights_from(self, source): for i in range(self.num_layers): tie_weights(src=source.convs[i], trg=self.convs[i])