def _set_activations(self, minibatch, set_val=True, corrupt=False):
        """
        Initializes the GSN as specified by minibatch.

        Parameters
        ----------
        minibatch : list of (int, tensor_like)
            The minibatch parameter must be a list of tuples of form
            (int, tensor_like), where the int component represents the index
            of the layer (so 0 for visible, -1 for top/last layer) and the
            tensor_like represents the activation at that level. Layer
            indices not included in the minibatch will be set to 0. For
            tuples included in the minibatch, the tensor_like component can
            actually be None; this will result in that layer getting set to 0
            initially.
        set_val : bool, optional
            Determines whether the method sets self.activations.
        corrupt : bool, optional
            Instructs the method to return both a non-corrupted and corrupted
            set of activations rather than just non-corrupted.

        Notes
        -----
        This method creates a new list, not modifying an existing list.
        This method also does the first odd step in the network.
        """
        activations = [None] * self.nlayers

        mb_size = minibatch[0][1].shape[0]
        first_layer_size = self.aes[0].weights.shape[0]

        # zero out activations to start
        activations[0] = T.alloc(0, mb_size, first_layer_size)
        for i in xrange(1, len(activations)):
            activations[i] = T.zeros_like(
                T.dot(activations[i - 1], self.aes[i - 1].weights)
            )

        # set minibatch
        for i, val in minibatch:
            if val is not None:
                activations[i] = val

        indices = [t[0] for t in minibatch if t[1] is not None]
        self._update_odds(activations, skip_idxs=indices, corrupt=False)

        if set_val:
            self.activations = activations

        if corrupt:
            return (activations +
                    self.apply_postact_corruption(activations[:],
                                                  xrange(len(activations))))
        else:
            return activations