반응형
model( 모델 정의 )-동영상 필기 자료 ][ 테스트 해보기 : Y = 3x
필기내용 : https://speedr00t.tistory.com/770
dictionary][ model( 모델 정의 )-동영상 필기 자료
그 동안 체득한 습관으로는 deep learning 정확하게 이해하기 힘들다.. 입력을 넣으면 처리되고 결과 나온다는 기본적인 생각이다 처리(규칙) 대해서는 사람이 코딩하고 입력도 사람이 넣고 그 계산된 결과를 컴퓨..
speedr00t.tistory.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# hacker@ubuntu:~$ uname -a | |
# Linux ubuntu 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | |
# | |
sudo apt-get install python3-dev | |
sudo apt-get install openssh-server | |
sudo apt-get install python3-pip | |
sudo pip3 install --upgrade pip | |
sudo apt-get install python3-setuptools | |
sudo apt-get install python-launchpadlib | |
sudo apt-get install build-essential cmake git unzip pkg-config libopenblas-dev liblapack-dev | |
sudo apt-get install python-numpy python-scipy python-matplotlib python-yaml | |
sudo pip3 install matplotlib | |
sudo apt-get install graphviz | |
sudo pip3 install pydot-ng | |
sudo apt-get install python-opencv | |
sudo pip3 install tensorflow | |
sudo pip3 install keras |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import keras | |
model = keras.Sequential([keras.layers.Dense(units=1,input_shape=[1])]) | |
model.compile( optimizer='sgd',loss='mean_squared_error') | |
# y = 3x | |
x = np.array([-1.0,0.0,1.0,2.0,3.0,4.0] , dtype=float ) | |
y = np.array([-3.0,0.0,3.0,6.0,9.0,12.0] , dtype=float ) | |
model.fit( x , y, epochs=500) | |
# y = 3x | |
# x = 10.0 | |
# y = 3 * 10.0 | |
print( model.predict([10.0])) |

반응형
'Deep learning > 0x02-simple test' 카테고리의 다른 글
model( 모델 정의 )-동영상 필기 자료 ][ x**2 테스트 해보기 (0) | 2020.01.09 |
---|---|
model( 모델 정의 )-동영상 필기 자료 ][ 테스트 해보기 : Y = 3x , input 자동 (0) | 2020.01.09 |
model( 모델 정의 )-동영상 필기 자료 ][ 테스트 해보기: Y = 2X -1 (0) | 2020.01.08 |