tensorfly-gpu / aichess Goto Github PK
View Code? Open in Web Editor NEW使用alphazero算法打造属于你自己的象棋AI
License: MIT License
使用alphazero算法打造属于你自己的象棋AI
License: MIT License
作者您好,请问走了一次前向传播的policy_value_fn预测出来的走子概率及状态估值都是Nan是怎么回事啊
大佬您好,我在看您写的Alpha chess,并按照您的意思,在自己写一个。
但是在collect过程中,他会做出不合法的动作,然后报错。
找了半天也没找到在哪里出问题了。
就是在您的这个demo里面,网络直接输出2084个动作,但是这些动作也是有不合法的,这不合法的动作,在哪里去掉或者约束呢。
因为马上要交作业了,所以有点着急请教您。
File "D:\MyResource\transport\aichess\zip_array.py", line 51, in zip_array
return np.array(zip_res)
^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (123,) + inhomogeneous part.
要在返回的地方加一个return np.array(zip_res, dtype=object)
game.py graphic函数的调用是否都错了?
是否应该是下边这个样子??
if is_shown:
self.graphic(self.board, self.board.id2color[player1.player], self.board.id2color[player2.player])
已加载初始模型
F:\aichess-main\pytorch_net.py:75: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.
policy = F.log_softmax(policy)
D:\Anaconda\envs\chess\lib\site-packages\torch\nn\functional.py:1949: UserWarning: nn.functional.tanh is deprecated. Use torch.tanh instead.
warnings.warn("nn.functional.tanh is deprecated. Use torch.tanh instead.")
走一步要花: 5.746572971343994
走一步要花: 5.981132745742798
F:\aichess-main\zip_array.py:51: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
return np.array(zip_res)
存储失败
请问下输入特征9109是怎么讲棋盘及棋子分布编码的
大神的代码写的非常精巧,因为我是个小白,我看了您的代码不太理解是怎么调用的gpu,我感觉tensor还是跑在cpu上饿。。。
Line 118 in a0ca324
如题所问。
题外再问一下:
象棋有规定的游戏规则,可以在修改象棋本来规则的情况下,训练ai吗?
比如一方的兵可以走两步,但是让出车马炮,另一方只能按原规则。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.