-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathutils.py
More file actions
48 lines (40 loc) · 1.25 KB
/
Copy pathutils.py
File metadata and controls
48 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import numpy as np
def initial_weights(input_size):
'''Helper function to create a weight variable initialized with
a normal distribution
Parameters
----------
shape : list
Size of weight variable
'''
# W = np.random_normal((input_size, 6), mean=0.0, stddev=0.01)
W = np.zeros((input_size, 6))
b = np.array([[1., 0, 0], [0, 1., 0]], np.float32)
return [W, b.flatten()]
def initial_weights_scale(input_size):
'''Helper function to create a weight variable initialized with
a normal distribution
Parameters
----------
shape : list
Size of weight variable
'''
# W = np.random_normal((input_size, 6), mean=0.0, stddev=0.01)
W = np.zeros((input_size, 3))
b = np.array([1, 0, 0], np.float32)
# W = np.zeros((input_size, 1))
# b = np.array([1], np.float32)
return [W, b.flatten()]
def initial_weights_without_scale(input_size):
'''Helper function to create a weight variable initialized with
a normal distribution
Parameters
----------
shape : list
Size of weight variable
'''
W = np.zeros((input_size, 2))
b = np.array([0, 0], np.float32)
# W = np.zeros((input_size, 1))
# b = np.array([1], np.float32)
return W, b.flatten()