Comments (4)
혹시 케라스와 텐서플로우 버전이 어떻게 되나요? 저희가 이 책 예제를 만들 때 썼던 버전이 있는데 최근 버전을 사용하면 문제가 생길 수도 있지 않을까 싶어요.
from reinforcement-learning-kr.
혹시 케라스와 텐서플로우 버전이 어떻게 되나요? 저희가 이 책 예제를 만들 때 썼던 버전이 있는데 최근 버전을 사용하면 문제가 생길 수도 있지 않을까 싶어요.
답변 감사합니다. 일단 명시되어 있는 버전까지는 다운그레이드 하면 안돌아가서 버전을 낮추긴 했는데, 잘 안되네요. 그래서 제가 직접 짜보고 있는데 궁금한게 있어서 몇 가지 여쭈어 보려고 합니다. 가능하시면 답변 주시면 정말 감사해요.
if name == "main":
# 환경과 에이전트의 생성
env = Env()
agent = ReinforceAgent()
global_step = 0
scores, episodes = [], []
for e in range(EPISODES):
done = False
score = 0
# env 초기화
state = env.reset()
state = np.reshape(state, [1, 15])
while not done:
global_step += 1
# 현재 상태에 대한 행동 선택
action = agent.get_action(state)
여기 메인에서 보면 action = agent.get_action(state)가 있고 이거 관련된 부분이 아래 함수인데,
정책신경망으로 행동 선택
def get_action(self, state):
policy = self.model.predict(state)[0]
return np.random.choice(self.action_size, 1, p=policy)[0]
에피소드가 첫 번째라 하면 아무것도 훈련(train) 된게 없는데 어떻게 predict를 할 수가 있는건가요?
초기 선언 보면
def __init__(self):
self.load_model = False
# 가능한 모든 행동 정의
self.action_space = [0, 1, 2, 3, 4]
# 상태와 행동의 크기 정의
self.action_size = len(self.action_space)
self.state_size = 15
self.discount_factor = 0.99
self.learning_rate = 0.001
self.model = self.build_model()
self.optimizer = self.optimizer()
self.states, self.actions, self.rewards = [], [], []
if self.load_model:
self.model.load_weights('./save_model/reinforce_trained.h5')
마지막 줄에 load_weight를 불러오는데 이미 훈련된 모델을 불러온 상태이기 때문에 predict를 할 수 있는건가요? 제가 이해를 제대로 한건지 궁금합니다 ㅜ
from reinforcement-learning-kr.
뉴럴네트워크를 만들었으니까 predict를 할 수 있어요. 학습 여부와는 상관없어요.
from reinforcement-learning-kr.
뉴럴네트워크를 만들었으니까 predict를 할 수 있어요. 학습 여부와는 상관없어요.
친절한 답변 감사합니다!
from reinforcement-learning-kr.
Related Issues (20)
- p.147 부등호가 책과 반대입니다.
- module 'tensorflow' has no attribute 'get_default_graph' 발생 HOT 2
- predict 값 nan 출력
- play_dqn_model.py 의 score 문제 HOT 5
- 파이썬 3.7버전에선 tensorflow가 install이 안되는건가요? HOT 1
- 3-atari에서 breakout_a3c.py 실행에 관한 문제 HOT 3
- 그림과 수식에 대한 파일은 안올려주시나요? HOT 3
- 멀티쓰레드 학습에 관련해서 질문이 있습니다.
- 제 3장 코드에서 width,height 혼동 문제.
- monte carlo에서 왜 last visit 방식으로 구현?
- 아타리 브레이크 아웃 설치 과정 오류 생깁니다. HOT 1
- 1-grid-world/7-reinforce/reinforce_agent.py 오류 HOT 2
- p.198 수식 5.21 질문
- 아타리 설치가 잘 안됩니다 ㅠㅠ
- Q-learning epsilon parameter for Epsilon-greedy action selection
- MC_learning.py 관련 문의
- 코드 실해 해봤는데 # 정책신경망을 업데이트하는 훈련함수 생성 부분에서 에러가 나요 HOT 4
- 1-grid-world 1-policy-iteration 코드 에러 질문입니다.
- 2-cartpole 2-actor-critic의 VisibleDeprecationWarning 오류 (넘파이 버전문제??)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reinforcement-learning-kr.