본문 바로가기
Deep learning/0x02-simple test

model( 모델 정의 )-동영상 필기 자료 ][ 테스트 해보기 : Y = 3x

by SpeeDr00t 2020. 1. 8.
반응형

model( 모델 정의 )-동영상 필기 자료 ][ 테스트 해보기 : Y = 3x

필기내용  : https://speedr00t.tistory.com/770

 

dictionary][ model( 모델 정의 )-동영상 필기 자료

그 동안 체득한 습관으로는 deep learning 정확하게 이해하기 힘들다.. 입력을 넣으면 처리되고 결과 나온다는 기본적인 생각이다 처리(규칙) 대해서는 사람이 코딩하고 입력도 사람이 넣고 그 계산된 결과를 컴퓨..

speedr00t.tistory.com

 

#
# 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
view raw keras.sh hosted with ❤ by GitHub
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]))
view raw 3x.py hosted with ❤ by GitHub

반응형