Exemple #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))
Exemple #2
0
def zeros(*shape, dtype=np.float32):
    return Tensor(np.zeros(shape, dtype=dtype))
Exemple #3
0
def empty(*shape, dtype=np.float32):
    return Tensor(np.empty(shape, dtype=dtype))
Exemple #4
0
def sample(*shape, dtype=np.float32):
    return Tensor(np.random.sample(shape).astype(dtype))
Exemple #5
0
def rand(*shape, dtype=np.float32):
    return Tensor(np.random.rand(shape).astype(dtype))
Exemple #6
0
def eye(*shape, dtype=np.float32):
    return Tensor(np.eye(shape).astype(dtype))
Exemple #7
0
def ones(*shape, dtype=np.float32):
    return Tensor(np.ones(shape, dtype=dtype))