d30902f8872e00e49596b3b7b3ee97bff1126b79,basenji/dataset.py,SeqDataset,numpy,#SeqDataset#Any#Any#,201

Before Change


    dataset = dataset.batch(1)

    // initialize inputs and outputs
    seqs_1hot = []
    targets = []

    // collect inputs and outputs
    for seq1_1hot, targets1 in dataset:
      if return_inputs:
        seqs_1hot.append(seq1_1hot)
      if return_outputs:
        targets.append(targets1)

    // make arrays

After Change




    // initialize inputs and outputs: this speeds it up insanely!
    seqs_1hot = np.zeros((self.num_seqs, self.seq_length, self.seq_depth))
    targets   = np.zeros((self.num_seqs, self.target_length, self.num_targets))
    counter = 0
    // collect inputs and outputs
    for seq1_1hot, targets1 in dataset:
      //print(seq1_1hot.shape, targets1.shape)
      if return_inputs:
        seqs_1hot[counter,:,:] = seq1_1hot[0,:,:]
      if return_outputs:
        targets[counter,:,:] = targets1[0,:,:] 
      counter += 1
    assert(counter == self.num_seqs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: calico/basenji
Commit Name: d30902f8872e00e49596b3b7b3ee97bff1126b79
Time: 2019-07-09
Author: geoff.fudenberg@gmail.com
File Name: basenji/dataset.py
Class Name: SeqDataset
Method Name: numpy


Project Name: lovit/soynlp
Commit Name: d60c4db95e26ad068b64c705b91d2f8bac6fb761
Time: 2017-09-11
Author: soy.lovit@gmail.com
File Name: soynlp/hangle/_hangle.py
Class Name: ConvolutionHangleEncoder
Method Name: encode


Project Name: PyMVPA/PyMVPA
Commit Name: 0759978553262a92a5eb6e7565e81b5bcb9a61f9
Time: 2008-03-10
Author: psederberg@gmail.com
File Name: mvpa/misc/signal.py
Class Name:
Method Name: __detrend_regress