반응형

아래 내용은 Udemy에서 Pytorch: Deep Learning and Artificial Intelligence를 보고 정리한 내용이다.

tensorflow install:

sudo pip install tensorflow

 

download anaconda

 

pip install --upgrade pandas theano

 

pip install tensorflow

pip install keras

 

NVIDIA GPU

CUDA

CuDNN

 

at least four giga

 

 

pip install tensorflow

pip install tensorflow-gpu

 

tf.test.is_gpu_available()

 

cpu/gpu torch

pip install torch

 

pip install keras

 

 

How to Code Yourself

Techniques <-> practice

 

fit(X,y)

prediction(X)

 

which parts did I get right?

which parts did I get Wrong?

 

jupyter notebook

 

deeplearningcourses.com/catalog

 

Deep Learning Courses - Master Neural Networks, Machine Learning, and Data Science in Python, Theano, TensorFlow, and Numpy

Deep Learning: Advanced Computer Vision (GANs, SSD, +More!)

deeplearningcourses.com

 

text

images

 

vanishing gradients 어디서 생기는지 ?

 

RNN -> text

 

regression 

classification

 

ensumble machine learning

random forest and a boost

 

 

반응형
반응형

 

 

 

anacondapython명령어를

 

**Anaconda 설치

=>path 환경변수 : 디렉토리를 등록해서 디렉토리에 있는 명령어들을 아무곳에서나 사용할 수 있도록 해주는 환경변수

=>설치할 때 체크하지 않았다면 설치 한 후 python명령어 디렉토리를 추가해주면 된다.

 

PYTHON IDE

1. CONSOLE : PYTHON만 설치하면 제공 - 콘솔에 Python이라고 명령어를 입력하고 사용

=>명령어 입력 모드 가 불편해서 python라이브러리 설치하는 경우 주로 사용

 

2.python idle: python만 설치하면 제공 - 파일에 작성해서 한 번에 실행이 가능

=>editor 기능만 제공하기 때문에 잘 사용하지 않음

 

3.Jupyter Notebook :별도로 설치가 가능하고 anaconda 를 설치하면 자동으로 설치

=>웹 브라우저에서 실행이 가능

=>셀 단위 작성이 가능하고 텍스트와 이미지를 화나의 화면에 출력 가능

=>작성한 후 보고서 만들기가 편리

=>코드 센스가 동작하지 않음

 

 

4. 기타(spyder, pycharm , vscode)

=>spyder의 경우는 anaconda 를 설치하면 자동 설치가 됩니다.

=>코드 센스가 동작하고 디버깅이 편리

=>이미지가 별도로 출력되고 보고서 만들기가 불편

 

 

 

 

**웹에서 데이터 가져오기

1.    기본 패키지 이용

=>urllib urllib2 패키지를 이용해서 가져올 수 있음

1)request모듈 요청

=>urlopen이라는 메소드에 url을 문자열로 대입하면 response타입의 객체가 리턴

=>responsegetheaders()를 호출하면 서버의 정보를 읽을 수 있고 status 속성을 이용하면 서버의 상태 정보를 읽을 수 있음

read()를 호출해서 내용을 읽을 수 있음'

=>읽어온 텍스트가 깨지는 경우에는 response객체.info().get_content_charset()을 이용해서 인코딩 정보를 리턴받고 read().decode(인코딩 정보)를 호출하면 원본 텍스트를 읽을 수 있습니다.

 

 

실습 http://www.daum.nethtml을 전부 가져오기

 

#패키지 사용

import urllib.request

 

#데이터 요청

response = urllib.request.urlopen('http://www.daum.net')

#데이터 출력

data = response.read()

print(data)

 

#한글이 깨지는 경우

encoding  = response.info().get_content_charset()

html = data.decode(encoding)

print(html)

데이터만 쓰질 가능성이 있다. 출력하는 코드이다.

 

=>주피터 노트북에서는 마지막에 데이터이름만 사용하면 자동으로 출력

 

2)URL에 한글이나 특수문자가 있는 경우

=>요청 URL 에 한글이나 특수문자가 있으면 URL 도 인코딩을 해주어햐 합니다.

URL에 한글이나 특수문자가 있다고 해서 전부 인코딩하는 것이 아니고 파라미터 부분만 인코딩하면 됩니다.

 

URL을 화인할 때 ?다음 부분에 한글이 있는지 확인하면 된다.

파라미터 부분을 인코딩하고자 할 때는 urllib.parse모듈의 quote_plus 함수나 quote함수를 이용

 

#필요한 모듈 import - 모듈을 가져오는 것입니다.

#패키지 사용

import urllib.request

#urllib.parse 에서 quote만 가져오고 앞의 모듈이름은 제거

from urllib.parse import quote

 

#데이터 요청

#http://www.daum.net

response = urllib.request.urlopen('https://search.naver.com/search.naver?sm=tab_hty.top&fbm=1&ie=utf8&query='+quote('코로나'))

#데이터 출력

data = response.read()

print(data)

 

#한글이 깨지는 경우

#웹에서 받아온 데이터가 깨지면 인코딩을 받아서 디코딩을 해주어야 함

#공공기관 홈페이지에서 많이 발생한다.

encoding  = response.info().get_content_charset()

html = data.decode(encoding)

print(html)

 

 

반응형

'Study > 데이터 분석' 카테고리의 다른 글

데이터분석-6  (0) 2020.11.10
데이터분석-5  (0) 2020.11.09
데이터분석-4  (0) 2020.11.08
데이터분석-3  (0) 2020.11.08
데이터분석-2  (0) 2020.11.08
반응형

site: https://pytorch.org/

system 버전에 맞는 pytorch 버전을 선택한다.

pytorch 선택

 

pytorch anaconda설치 

 

1. pytorch 가상환경 만들기

conda create -n pytorch1 python=3.7

conda activate pytorch1

2. 라이브러리들 설치 https://pytorch.org/
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch 
cpu만을 사용할 경우
conda install pytorch torchvision cpuonly -c pytorch

conda install jupyter pandas matplotlib


3. anaconda cmd 창에서 

jupyter notebook

반응형

'Deep learning > 환경설정' 카테고리의 다른 글

yolov5 환경 설정하기  (3) 2020.11.23
visual studio code 연동 git  (0) 2020.11.02
anaconda kernel생성  (0) 2020.10.28
yolo3 labelImage사용법  (0) 2020.09.26

+ Recent posts