본문 바로가기
TIL/디지털트윈

08.02 디지털 트윈 부트캠프(OT) 23일차

by saramnim 2023. 8. 2.
728x90

28일은 아파서 결석, 7/8일은 학원 사정으로 특강 대체! 로 19 -> 23일차가 되었다!


Python

딥러닝 ∈ 머신러닝 ∈ 인공지능 -> 목적에 따라 갈린다.

 

인공지능

인공지능

인간의 학습 능력, 추론 능력, 지각 능력을 인공적으로 구현하려는 CS의 세부 분야 중 하나

인간의 지능을 모방 -> 자체 성능을 반복적으로 개선할 수 있는 시스템

 

머신러닝

기계학습: 경험을 통해 자동으로 개선하는 컴퓨터 알고리즘의 연구

알고리즘과 기술을 개발하는 분야

결정 = 비교 + 선택

 

딥러닝

인공신경망(ANN)

심층신경망(DNN): 입력층과 출력층 사이에 여러 개의 은닉층들로 이뤄진 인공신경망 

정확도가 높다

데이터 셋이 바뀔 때마다 모델리 달라짐 / 학습 속도 ↓ / 추적 어려움

 

머신러닝

label: 정답 -> 최종적으로 예측해야 하는 것

Features: 특징 -> 판단에 필요한 요소

Example / Trainig Data: 학습용 데이터

Label 값이 있고 없음에 따라 지도 학습, 비지도 학습Trainig data set: 데이터가 2개 이상, 정보들의 집합Model: 판단 모델 -> features와 label 간의 관계를 찾아내는 판단 모델 및 함수

ex)

teachablemachine

https://teachablemachine.withgoogle.com/

 

Teachable Machine

Train a computer to recognize your own images, sounds, & poses. A fast, easy way to create machine learning models for your sites, apps, and more – no expertise or coding required.

teachablemachine.withgoogle.com

 

AutoDraw

https://www.autodraw.com/

 

AutoDraw

Fast drawing for everyone. AutoDraw pairs machine learning with drawings from talented artists to help you draw stuff fast.

www.autodraw.com

 

Quick Draw

https://quickdraw.withgoogle.com/

 

Quick, Draw!

신경망이 학습을 통해 낙서를 인식할 수 있을까요? 내 그림은 얼마나 잘 맞추는지 확인하고, 더 잘 맞출 수 있도록 가르쳐 주세요. 게임을 플레이하기만 하면 됩니다.

quickdraw.withgoogle.com

 

파이썬

직관적인 사고체계, 쉬운 문법, 빠른 속도, 동적 타입 언어

사용툴 : https://colab.research.google.com/ 

 

Google Colaboratory

 

colab.research.google.com

 

사칙연산

+, -, *, /

divmod(a, b): a / b의 몫, 나머지를 순서대로 출력

 

변수

선언 초기화 간단

hi = "hello"
hi

hello 출력

 

리스트

hi = ["1", "2", "#"]
hi[1]	# "2"
len(hi)	# 3
import numpy as np

hi = np.array(["1", "2", "#"])
hi[1]	# 2
hi.shape	# (3, )
len(hi)	# 3

 

for 문

for (변수) in (배열):
  (내용)

indent: tab 1번 / space 4칸

python은 들여쓰기도 문법

for i in range(10)
  print(i)

range(시작, 끝, 건너뛰기)

ex) range(1, 10, 1)

hi = ["1", "2", "3"]
for i in hi:
  print(i)	# 1 2 3

 

슬라이싱

hi[0:2]	# [1, 2]
hi[1:]	# [2, 3]
hi[1:2]	# [2]
hi[:1]	# [1]
hi[:-1]	# [1, 2]

 

numpy

import numpy as np

zeros

배열을 0으로 채움

zero = np.zeros((2, 5))
zero
# array([[0., 0., 0., 0., 0.],
#       [0., 0., 0., 0., 0.]])

ones

배열을 1로 채움

one = np.ones((2, 5))
one
# array([[1., 1., 1., 1., 1.],
#       [1., 1., 1., 1., 1.]])

random.rand

랜덤 숫자 추출

r = np.random.rand(3)
print(r)	# [0.39479744 0.56347229 0.27057521]

 

matplotlib.pyplot

그래프 그리기

import matplotlib.pyplot as plt
r1000 = np.random.rand(1000)
plt.hist(r1000)
plt.grid()

random.normal

랜덤 숫자 정규화 추출

rn = np.random.normal(0, 5, 9)
rn

rn1000 = np.random.normal(0, 10, 100)
plt.hist(rn1000)
ply.grid()

random.randit(a, b, c)

a부터 b까지의 수 중 c 개의 랜덤 숫자 출력

ni = np.random.randaint(1, 100, 10)
ni	# array([98, 13, 40, 48, 73, 56, 26, 52, 51, 45])

 

random.seed

random 값 고정

np.random.seed(0)
print(np.random.rand(3))
np.random.seed(0)
print(np.random.rand(3))
# [0.5488135  0.71518937 0.60276338]
# [0.5488135  0.71518937 0.60276338]

 

list와 np.array는 다른 타입이다.

 

reshape

rearray = np.array([[1,2,3],[4,5,6]])
hello = rearray.reshape(3,2)
hello
# array([[1, 2],
#        [3, 4],
#        [5, 6]])

 

if문

if(조건):
  (명령문)
if(조건):
  (명령문)
elif(조건):
  (명령문)
else:
  (명령문)

 

함수

def(함수이름)(매개변수):
  (함수의 내용)

 

dataset 사용예제

import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df_iris = sns.load_dataset("iris")
display(df_iris.head())
x = df_iris['sepal_length']
y = df_iris['sepal_width']
plt.scatter(x, y)
plt.show()

 

 

수업 시간에 PCCP 대비로 몇몇 문제들 풀어주셨다.

근데 나는 자바스크립트로 시험 볼 예정이라...자스로 풀었다!

2023.08.02 - [TIL/알고리즘] - 조금 어려운 알고리즘 - 예매 순위

2문제 더 있지만 올리진 않는다!

728x90
반응형

댓글

"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."