-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.py
More file actions
executable file
·49 lines (44 loc) · 780 Bytes
/
Copy pathdata.py
File metadata and controls
executable file
·49 lines (44 loc) · 780 Bytes
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
49
import numpy as np
train_data = ( # x, y, target
(0.2, 0.3, 0),
(0.8, 7, 0),
(2, 1, 0),
(2, 4, 0),
(1, 1, 0),
(2, 1, 0),
(2, 2.8, 0),
(2, 2.2, 0),
(3, 1, 0),
(5, 3, 1),
(5, 4, 1),
(4, 5, 1),
(4, 7, 1),
(5, 5.1, 1),
(5.5, 6, 1),
(6, 5, 1),
(6, 6.5, 1),
(6, 7, 1)
)
validate_data = (
(1, 1),
(2, 2),
(2, 1),
(5, 4),
(6, 5),
(6, 6)
)
logic_gate_and = (
(0, 0, 0),
(1, 0, 0),
(0, 1, 0),
(1, 1, 1)
)
logic_gate_or = (
(0, 0, 0),
(1, 0, 1),
(0, 1, 1),
(1, 1, 1)
)
X_train = np.array([x[:2] for x in train_data]) # list comprehension
X_validate = np.array([x[:2] for x in validate_data]) # list comprehension
y = np.array([x[-1] for x in train_data])