This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
class DatasetNoLabel(object): | |
def __init__(self, data): | |
self._data = data | |
self._num_examples = data.shape[0] | |
self._epochs_completed = 0 | |
self._index_in_epoch = 0 | |
@property | |
def data(self): | |
return self._data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class Add: | |
def __init__(self): | |
pass | |
def forward(self, numlist): | |
self.numlist = numlist | |
return np.sum(numlist) | |
def backward(self, loss): | |
self.dnumlist = loss * np.ones(len(self.numlist)) |
NewerOlder