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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
import numpy as np
import matplotlib.pyplot as plt
def abcd():
img = imread("./abc.png")
def abc():
def abc1():
y = np.sin(x)
def flatten():
D = A.flatten()
print(D)
print(D > 15)
print(D[D > 15])
def abc2():
y1 = np.sin(x)
y2 = np.cos(x)
if __name__ == "__main__":
abc()
abc1()
flatten()
abc2()
abcd()
tp://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
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
|
import numpy as np
def AND(x1, x2):
b = -0.7
if tmp <= 0:
return 0
else:
return 1
def NAND(x1, x2):
b = 0.7
if tmp <= 0:
return 0
else:
return 1
def OR(x1, x2):
b = -0.2
if tmp <= 0:
return 0
else:
return 1
def XOR(x1, x2):
s1 = NAND(x1, x2)
s2 = OR(x1, x2)
y = AND(s1, s2)
return y
if __name__ == "__main__":
for xs in [(0, 0), (1, 0), (0, 1), (1, 1)]:
y = XOR(xs[0], xs[1])
print(str(xs) + " -> " + str(y))
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'딥러닝 기반 영상인식 개발 전문가 과정 > C언어, Python, 자료구조' 카테고리의 다른 글
7월26일 항등함수와 소프트맥스함수 (0) | 2019.07.26 |
---|---|
7월24일 파이썬 텐서플로우 기반 머신러닝 기초 (0) | 2019.07.24 |
7월23일 파이썬 str메서드, 오버로딩, jupyter, Pandas (0) | 2019.07.23 |
7월22일 파이썬 코드 (0) | 2019.07.22 |
7월22일 파이썬 날짜와 시간, 모듈, 클래스 (0) | 2019.07.22 |