본문 바로가기

2/[ Machine Learning ]30

Keras model.summary() result - Understanding the # of Parameters Reference: https://stackoverflow.com/questions/36946671/keras-model-summary-result-understanding-the-of-parameters Keras model.summary() result - Understanding the # of Parameters I have a simple NN model for detecting hand-written digits from a 28x28px image written in python using Keras (Theano backend): model0 = Sequential() #number of epochs to train for nb_epoch = 12 # stackoverflow.com It .. 2023. 5. 8.
[Reinforcement Learning] The Limits of Dynamic Programming 1. 계산 복잡도 DP를 적용하는 문제의 규모가 거대하다면 계산만으로 풀어내기에는 한계가 있다. DP의 계산 복잡도는 State 크기의 3제곱에 비례한다. 따라서 DP로는 경우의 수가 우주의 원자 수보다 많은 바둑과 같은 문제는 절대 풀 수 없다. 2. 차원의 저주 State가 2차원으로 표현되는 (x, y)가 아닌 n차원이라면, State의 수가 지수적으로 증가한다. 계산 복잡도가 증가하므로 해결할 수 없다. 3. Environment에 대한 완벽한 정보 Reward와 State 변환 확률을 정확히 알고 해결할 수 있는 문제는 거진 없다. 따라서 Environment를 모르지만 Env와의 상호작용을 통해 경험을 바탕으로 학습하는 방법이 강화학습이다. RL과 DP의 차이는 RL은 Env의 Model을 몰.. 2022. 1. 16.
[Reinforcement Learning] RL open source sharing sites https://www.kaggle.com/search?q=reinforcement+learning+code+in%3Anotebooks Search | Kaggle www.kaggle.com https://medium.com/ai%C2%B3-theory-practice-business/reinforcement-learning-part-1-a-brief-introduction-a53a849771cf Reinforcement Learning, Part 1: A Brief Introduction What is Reinforcement Learning and how is it used? Find out in 5 minutes! medium.com https://www.analyticsvidhya.com/blog/.. 2022. 1. 13.
[ANACONDA] Anaconda 실행이 갑자기 안될 때 언젠가 갑자기 ANACONDA가 실행이 안됐다. 머 cmd로 jupyter notebook 실행해서 사용하면 되니까, 상관이 없었는데, 강화학습하려고 코드 굴리는데, 중간 중간 pip install 해야할게 있어서 cmd실행으로 사용하는건 불편함이 있어서 찾아보았다. 아래 방법으로 하니까 잘 된다. 1. cmd 관리자 권한 실행 2. pip uninstall PyQt5 입력 3. conda update conda 입력 4. conda update anaconda-navigator 입력 2021. 7. 5.
[GAN] GAN: Generative Adversarial Nets Source: arxiv.org/abs/1406.2661 Generative Adversarial Networks We propose a new framework for estimating generative models via an adversarial process, in which we simultaneously train two models: a generative model G that captures the data distribution, and a discriminative model D that estimates the probability that arxiv.org GAN(Generative Adversarial Nets): Generator(생성자)와 Distriminator(판별자).. 2021. 2. 3.
[Scikit-learn] Data Scale Method 2021. 2. 2.
[GAN] Numerical Data Generate SOURCE - machinelearningmastery.com/how-to-develop-a-generative-adversarial-network-for-a-1-dimensional-function-from-scratch-in-keras/ How to Develop a 1D Generative Adversarial Network From Scratch in Keras Generative Adversarial Networks, or GANs for short, are a deep learning architecture for training powerful generator models. A generator model is capable of generating new artificial sample.. 2021. 1. 28.
[GAN] 오토인코더와 GAN을 사용한 표현 학습과 생성적 학습 SOURCE: Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow Autoencoder: 어떤 지도 없이도(Label되어 있지 않은 Train Data를 사용해서) Latent Representation 또는 Coding이라 부르는 Input Data의 밀집 표현을 학습할 수 있는 인공 신경망 - 일반적으로 입력보다 훨씬 낮은 차원을 가지므로 Autoencoder가 차원 축소, 특히 시각화에 유용하게 사용됨 - 강력한 추출기처럼 작동하므로 DNN의 비지도 사전훈련에 사용 가능 - Train Data와 매우 비슷한 새로운 data 생성 가능 → Generative Model(생성 모델), but 생성된 이미지가 흐릿하고 실제 이미지 같지는 않다.. 2021. 1. 26.
[Reinforcement Learning] Pang-Yo Lab Lecture 1: Reinforcement Learning Introduction reward(Rt) = scalar feedback Definition(Reward Hypothesis) - All goals can be described by maximistion of expected cumulative reward Markov State(=Information State) - St+1은 St에 의해서만 결정됨 - 지금 당장 형 상황이 어떤지 다 표현이 되는 상황(완전 독립적 State) - 미래는 현재에 의해서만 결정됨 Full observability: agent directly observes environment state - Agent state = environment, State = in.. 2021. 1. 15.
[Reinforcement Learning] Reinforcement Learning by Sung Kim Source: Youtube 모두를 위한 RL강좌 - Sung Kim www.youtube.com/playlist?list=PLlMkM4tgfjnKsCWav-Z2F-MMFRx-2gMGG Lecutre 3: Q-Learning (Table) Policy using Q-function Max Q = maxQ(s1, a): Q 형님이 가질 수 있는 Rewards 중 제일 높은 값 π*(s) = argmaxQ(s1, a): Q 형님이 가질 수 있는 Rewards 중 제일 높은 값이 있는 Action Assum (belive) Q in s' exist The Condition - I am in s - When I do action a, I will go to s' & get reward r - Q in s', Q.. 2021. 1. 14.
[Reinforcement Learning] RL Concepts [Video Lectures] RL by Sung Kim: youtu.be/dZ4vw6v3LcA Pang-Yo Lab: youtu.be/wYgyiCEkwC8 Actor Critic: youtu.be/2vJtbAha3To Agent: 사람 Enviornment: 강아지 Action: 행동 Reward(R): 느낌 사람(Agent)이 강아지(Enviornment)를 꾸짖었는데(Action), 강아지가 좋아했다(Reward). 사람(Agent)이 강아지(Enviornment)를 끌어안았는데(Action), 강아지가 싫어했다(Reward). Environment를 정의하는 것이 중요 Policy Iteration - Policy 평가(가치함수를 업데이트)와 Policy 발전(Policy를 업데이트)으로 구성 V.. 2021. 1. 12.
[PyTorch] PyTorch 설치 1. PyTorch 홈페이지 접속 후 다운로드 pytorch.org/ PyTorch An open source deep learning platform that provides a seamless path from research prototyping to production deployment. pytorch.org 2. 설치 코드 복사 3. cmd 관리자 권한으로 실행 후, 설치 원하는 환경 activate 후 복사한 코드 입력 2021. 1. 7.
DataFrame 엑셀(xlsx, csv) 파일 형식으로 저장하기 df.to_csv('sample.csv') 혹은 df.to_csv('sample.xlsx') # sample은 파일 제목, 변경 가능 입력하면 쥬피터 노트북이 열려 있는 같은 폴더에 저장된다. 2021. 1. 6.
Tensorflow-GPU 사용하기 1. 아나콘다 최신버전 설치 2. cmd 관리자 권한 실행 - activate base 입력 - conda update conda - conda update anaconda - conda update python - conda update --all - conda create --name !@#!@# pyhthon=3.7 # "!@#!@#" ← 가상환경 이름 3. Software 호환 사항 점검(tensorflow-gpu==2.1.0 기준) # 여기 참고 - NVIDA GPU driver 418.x 이상 버전 설치 - Microsoft Visual C++ 2019 설치 - Python v3.7 - CUDA 10.1 설치 # 여기 참고 - cuDNN 7.4 설치 # 여기 참고 4. tensorflow-gp.. 2020. 12. 27.
Keras Initializer keras.initializers 종류 keras는 기본적으로 균등분포의 Glorot 초기화를 사용한다. 다음과 같이 층을 만들 때, kernel_initializer = "he_uniform" 이나 kernel_initializer = "he_normal"로 바꾸어 He 초기화를 사용할 수 있다. fan_in 대신 fan_out 기반의 균등분포 He 초기화를 사용하고 싶다면 다음과 같이 Variance Scaling을 사용할 수 있다. 2020. 12. 23.