일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- error
- 딥러닝
- 백준
- 코딩
- CV
- 쉘
- 공부
- 백준알고리즘
- Windows10
- python
- c
- 프로세스
- 프로그래밍
- 시스템프로그래밍
- 알고리즘
- shell
- C++
- 리눅스
- 운영체제
- Windows 10
- 회귀
- C언어
- 영상처리
- linux
- TensorFlow
- Computer Vision
- OpenCV
- 학습
- 턱걸이
- 텐서플로우
- Today
- Total
목록학습 (11)
줘이리의 인생적기
그래프와 어느정도 친해졌으니 앞서 배운 XOR 학습 시킬 때 잘 되고 있는지 시각화 해보겠습니다. import tensorflow as tf import math import numpy as np import matplotlib.pyplot as plt x = np.array([[1,1], [1,0], [0,1], [0,0]]) y = np.array([[0], [1], [1], [0]]) model = tf.keras.Sequential([tf.keras.layers.Dense(units=2, activation='sigmoid', input_shape=(2,)), tf.keras.layers.Dense(units=1, activation='sigmoid')]) model.compile(optimize..
결론부터 말하자면, 하나의 퍼셉트론으로는 간단한 XOR연산자도 만들어낼 수 없습니다. (Marvin Minsky, Seymour Papert가 증명) 안 되는 XOR 네트워크를 만들어볼 텐데, 앞서 공부한 OR, AND 연산처럼 XOR 진리표부터 보겠습니다. import tensorflow as tf import math import numpy as np def sigmoid(x): return 1 / (1 + math.exp(-x)) x = np.array([[1,1], [1,0], [0,1], [0,0]]) y = np.array([[0], [1], [1], [0]]) # 거짓 참 참 거짓 w = tf.random.normal([2], 0, 1) b = tf.random.normal([1], 0, 1..
sigmoid 활성화 함수를 구현하여, 입력이 1일 때 출력이 0이 되는 뉴런을 만들어보겠습니다. import tensorflow as tf import math def sigmoid(x): return 1 / (1 + math.exp(-x)) x = 1 y = 0 w = tf.random.normal([1], 0, 1) output = sigmoid(x * w) error = y - output print("output = ", output) print("error = ", error) 0이 되기에는 역부족으로 보입니다. 이제 w값을 변화시켜야 하는데 경사하강법을 사용해보겠습니다. 경사하강법은 w에 입력과 학습률(α)과 error를 곱한 값을 더해주는 것입니다. w = w + x * α * error ..