Comments (3)
Thanks for the quick feedback VInce, no rush :)
Just want to let you know that the support_enumeration method works just fine.
from nashpy.
Thanks for raising this @HLiuUS, I will investigate. The game is pretty degenerate so that might be causing some trouble although the mixup in the dimensions seems to indicate an issue that's fixable. One easy improvement of current behaviour would be to at least raise an error if the dimensions aren't correct (for all algorithms)...
It might be a little while before I look at this (a lot of marking/grading this time of year) but I will. Thanks again for taking the time to open the issue 👍
For my own records:
>>> A = [[-1, -1, -1], [0, 0, 0], [-1, -1, -10000]]
>>> B = A
>>> game = nash.Game(A, B)
>>> list(game.support_enumeration())
[(array([ 0., 1., 0.]), array([ 1., 0., 0.])),
(array([ 0., 1., 0.]), array([ 0., 1., 0.])),
(array([ 0., 1., 0.]), array([ 0., 0., 1.]))]
>>> list(game.vertex_enumeration())
[(array([ 0., 1., 0.]), array([ 0., 0., 1.])),
(array([ 0., 1., 0.]), array([ 0., 1., 0.])),
(array([ 0., 1., 0.]), array([ 1., 0., 0.]))]
>>> list(game.lemke_howson(0))
[array([ nan, nan]),
array([ 3.33344446e-01, 3.33344446e-01, 3.33344446e-01,
-3.33377784e-05])]
from nashpy.
Thanks again for raising this @HLiuUS, I'm about to merge #36 which adds a warning when the output is nonsensical (as in the case you've sent here).
So now the output would look like:
/home/vince/src/Nashpy/src/nash/integer_pivoting/integer_pivoting.py:27: RuntimeWarning: invalid value encountered in true_divide
return np.argmax(tableau[:, column_index] / tableau[:, -1])
/home/vince/src/Nashpy/src/nash/algorithms/lemke_howson.py:54: RuntimeWarning: invalid value encountered in true_divide
return strategy / sum(strategy)
/home/vince/src/Nashpy/src/nash/algorithms/lemke_howson.py:113: RuntimeWarning: The Lemke Howson algorithm has returned probability vectors of
incorrect shapes. This indicates an error. Your game could be degenerate.
warnings.warn(msg, RuntimeWarning)
You can see many errors occur along the way because of the fact that the game is degenerate, the final error is the one I've added.
I am contemplating letting the algorithm fail all together but will just use warning for now.
from nashpy.
Related Issues (20)
- where is setup.py? HOT 1
- Add support for py3.10
- Add discussion documentation for Moran process
- Add approximate fixation function
- Returns empty equilibrium
- NASHPY strengh HOT 1
- module 'numpy.typing' has no attribute 'NDArray' HOT 1
- Add more tests for Moran process
- Too low numpy version requirement in pyproject.toml HOT 1
- Fix Alex in CI
- Fix mypy in CI
- massive complexity improvement for fictitious play HOT 2
- Write theory docs on evolutionary graph theory (Moran processes on graphs)
- Add some performance regression tests HOT 1
- Add tests for individual methods in the tableaux
- Remove basic lemke howson algorithm
- Add open-graph extension to docs
- Fix bug in stochastic fictitious play HOT 2
- Improve use of pytest-memray HOT 1
- Not all Nash Equilibria are found by support_enumeration HOT 1
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 nashpy.