rl_learning's Issues
请问solver.py文件是否调用了render.py文件,目前好像只用了grid_env.py,那么render.py是干什么用的
想问一下关于固定策略的问题
作者你好,感谢能够开源代码,我在自己尝试复现的过程中遇到了一些问题,然后我在训练了您的模型1000轮之后想要看看固定后的策略,发现结果并不是很理想,想知道是不是我的固定策略的代码出问题了呢?(我在运行时看不到作者写的输出部分,可能是有些库不完善)
下面贴出我的代码:
if (epoch+1)%50==0: # 测试
n_actions=5
action_img = ['↑', '→', '↓', '←','o'] # 五个方向对应的图标
print('--- test epoch ---')
# 固定策略(对于每个state固定)
for x in range(5):
for y in range(5):
s = torch.tensor((x, y), dtype=torch.float)
q_value = torch.zeros((n_actions), dtype=torch.float) # 分配五个活动对应的空间,下面分别计算
for act in range(n_actions):
nxt_s_in = torch.cat((s, torch.tensor(act).unsqueeze(0)))
# print(nxt_s_in)
q_value[act] = q_net(nxt_s_in)
max_idx = torch.argmax(q_value)
print(action_img[max_idx], end=' ')
print()
大致意思就是枚举每个状态(x,y)和每个活动action组成输入,预测最大的action的结果作为输出。
我得到的结果是这样的:
求助大佬回答
正在重构RL代码,参考的是jwk1rose作者的源码。插个眼睛,多多提意见,plz、
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.