コード例 #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))
コード例 #2
0
ファイル: _funcs.py プロジェクト: ludius0/Mercury
def zeros(*shape, dtype=np.float32):
    return Tensor(np.zeros(shape, dtype=dtype))
コード例 #3
0
ファイル: _funcs.py プロジェクト: ludius0/Mercury
def empty(*shape, dtype=np.float32):
    return Tensor(np.empty(shape, dtype=dtype))
コード例 #4
0
ファイル: _funcs.py プロジェクト: ludius0/Mercury
def sample(*shape, dtype=np.float32):
    return Tensor(np.random.sample(shape).astype(dtype))
コード例 #5
0
ファイル: _funcs.py プロジェクト: ludius0/Mercury
def rand(*shape, dtype=np.float32):
    return Tensor(np.random.rand(shape).astype(dtype))
コード例 #6
0
ファイル: _funcs.py プロジェクト: ludius0/Mercury
def eye(*shape, dtype=np.float32):
    return Tensor(np.eye(shape).astype(dtype))
コード例 #7
0
ファイル: _funcs.py プロジェクト: ludius0/Mercury
def ones(*shape, dtype=np.float32):
    return Tensor(np.ones(shape, dtype=dtype))