img = tf.reshape(img_inpt, (-1,) + tuple(self._img_size)) if self._difference_air: img -= tf.reshape(canvas_flat, tf.shape(img)) inpt_encoding = self._input_encoder(img) if self._difference_air: hidden_state = inpt_encoding else: with tf.variable_scope('rnn_inpt'): rnn_inpt...
I will write old source code and new one and you can check, if I am on the correct way. Keras 1.2.2: model_1 = Sequential() model_1.add(Embedding(7, 30, input_length=1)) model_1.add(Reshape(target_shape=(30,))) models.append(model_1) model_2 = Sequential() model_2.add(...
import torch import functools from torch import nn as nn from torch.nn import functional as F def pixel_unshuffle(x, scale): """ Pixel unshuffle. Args: x (Tensor): Input feature with shape (b, c, hh, hw). scale (int): Downsample ratio. Returns: Tensor: the pi...