(self, in_tensor, out_tensor, mask)
Create a new minibatch of ticker copy task data.

        Arguments:
            in_tensor (Tensor): Device buffer holding inputs
            out_tensor (Tensor): Device buffer holding outputs
            mask (numpy array): Device buffer for the output mask
Create a new minibatch of ticker copy task data.
Create a new minibatch of ticker copy task data .
def synthesize(self, in_tensor, out_tensor, mask):

        """
        Create a new minibatch of ticker copy task data.

        Arguments:
            in_tensor (Tensor): Device buffer holding inputs
            out_tensor (Tensor): Device buffer holding outputs
            mask (numpy array): Device buffer for the output mask
        """

        # All sequences in a minibatch are the same length for convenience
        seq_len = np.random.randint(1, self.seq_len_max + 1)
        time_steps = self.time_steps_func(seq_len)

        # Generate intermediate buffers of the right size
        inputs, outputs = super(CopyTask, self).fetch_io(time_steps)

        # Set the start bit
        inputs[-2, :self.be.bsz] = 1

        # Generate the sequence to be copied
        seq = np.random.randint(2,
                                size=(self.vec_size,
                                      seq_len * self.be.bsz))

        # Set the stop bit
        stop_loc = self.be.bsz * (seq_len + 1)
        inputs[-1, stop_loc:stop_loc + self.be.bsz] = 1

        # Place the actual sequence to copy in inputs
        inputs[:self.vec_size, self.be.bsz:stop_loc] = seq

        # Now place that same sequence in a different place in outputs
        outputs[:, self.be.bsz * (seq_len + 2):] = seq

        # Fill the device minibatch buffers
        super(CopyTask, self).fill_buffers(time_steps, inputs, outputs,
                                           in_tensor, out_tensor, mask)
def synthesize ( self , in_tensor , out_tensor , mask ) : # All sequences in a minibatch are the same length for convenience seq_len = np . random . randint ( 1 , self . seq_len_max + 1 ) time_steps = self . time_steps_func ( seq_len ) # Generate intermediate buffers of the right size inputs , outputs = super ( CopyTask , self ) . fetch_io ( time_steps ) # Set the start bit inputs [ - 2 , : self . be . bsz ] = 1 # Generate the sequence to be copied seq = np . random . randint ( 2 , size = ( self . vec_size , seq_len * self . be . bsz ) ) # Set the stop bit stop_loc = self . be . bsz * ( seq_len + 1 ) inputs [ - 1 , stop_loc : stop_loc + self . be . bsz ] = 1 # Place the actual sequence to copy in inputs inputs [ : self . vec_size , self . be . bsz : stop_loc ] = seq # Now place that same sequence in a different place in outputs outputs [ : , self . be . bsz * ( seq_len + 2 ) : ] = seq # Fill the device minibatch buffers super ( CopyTask , self ) . fill_buffers ( time_steps , inputs , outputs , in_tensor , out_tensor , mask )