Beispiel #1
0
 def __init__(self,
              n_inputs,
              n_neurons,
              biases=False,
              init_func="_uniform()",
              dtype=np.float32):
     self.weights = Tensor(_uniform(n_inputs, n_neurons, dtype=dtype))
Beispiel #2
0
def zeros(*shape, dtype=np.float32):
    return Tensor(np.zeros(shape, dtype=dtype))
Beispiel #3
0
def empty(*shape, dtype=np.float32):
    return Tensor(np.empty(shape, dtype=dtype))
Beispiel #4
0
def sample(*shape, dtype=np.float32):
    return Tensor(np.random.sample(shape).astype(dtype))
Beispiel #5
0
def rand(*shape, dtype=np.float32):
    return Tensor(np.random.rand(shape).astype(dtype))
Beispiel #6
0
def eye(*shape, dtype=np.float32):
    return Tensor(np.eye(shape).astype(dtype))
Beispiel #7
0
def ones(*shape, dtype=np.float32):
    return Tensor(np.ones(shape, dtype=dtype))