Code Monkey home page Code Monkey logo

pyeval7's People

Contributors

julianandrews avatar kolaf avatar yangrq1018 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyeval7's Issues

Why do I think that merging Win/Tie isn't (ever) the solution

Hi mate,

I am always me.
I will try to explain my issue and why I edited a piece of your code, and how and why so if you need it for your AI you can reuse it.

First of all, I edited equity.pyx (I added the bold to the changes):

cdef tuple hand_vs_range_monte_carlo(unsigned long long hand, ...):
cdef unsigned int wins = 0
cdef unsigned int tie = 0

    if hero > villain:
        **wins += 1**
    elif hero == villain:
        **tie += 1**

**return <double>wins / <double>iterations, <double>tie / <double>iterations**

Let me explain, I encountered a lot of problems trying to clustering rivers combinations (hand + 5 cards) and I have tried many different solutions (your equity, machine learning tequines like k-mean, manually and a combination of all these mentioned above).
The first solution was simply creating 1002 clusters (from equity 0, ..., 0.342, 0.343, ..., 0.5, ..., 0.789, ... to 1.0) but the problem was a missing of board informations. For him a board like "sssss" (a flush on the board) with no flushes in the cards of the hand was good as a middle pair. And of course that's not good. You can't cluster these two type of hands because are too different (AI was really weak with that type of clustering), but if you offer him the percentage of tie he can detect better a lot of board patterns.

My post isn't a issue, it was only a discussion to have a comparison and get more ideas.

And thank you for all

Benchmark 3 different solutions for fast deck generation

My code is 50% C++ and 50% Python and I connect the first with the second troguht different hacks (es. I generate dinamically C++ code with Python and then I include it with #include, or I open the shell, call the python script and it reads the pipeline and so on).

One problem I had is to generate a great number of hands trought your library in a "acceptable" time and I want to share with you my three different solutions with relative benchmarks.

import time
import random
import numpy as np
import eval7 as e7

######################
bench = time.time()
for i in range(1000000):
    deck = e7.Deck()
    deck.shuffle()
    hands = deck.deal(4)
    board = deck.deal(5)
print("bench1:", time.time() - bench)

######################
bench = time.time()
deck = e7.Deck()
deck.shuffle()
cards = deck.deal(52)
for i in range(1000000):
    random.shuffle(cards)
    hands = cards[:4]
    board = cards[4:9]
print("bench2:", time.time() - bench)

######################
bench = time.time()
num_iters = 1000000
combos = np.random.randint(52, size=(num_iters, 9))
deck = e7.Deck()
cards = np.array(deck.deal(52))
for i in range(1000000):
    hands = cards[combos[i][:4]]
    board = cards[combos[i][4:]]
print("bench3:", time.time() - bench)

bench1: 177.55185198783875
bench2: 77.64555835723877
bench3: 18.77227473258972

Vanilla eval7 is the worst, the most "compatible" with simple edit of library code is the second one, and the last one is the most difficult to integrate and reuse it but the difference of performances has no rivals.

Python 3.8 vectorcall incompatibility

When I run something like
d = Deck()

I get the error:
E TypeError: 'cython_function_or_method' object does not support vectorcall

It works fine on Python 3.7 however.

Range vs Range equity

Hi, it looks great.

I want make easy software to train Range vs Range equity on various flops. I am not good programmer, but if I understand it, pyeval7 dont have this function.

I tried pokereval, but results are differents from results in poker softwares, is it difficult to implement? Or dont you have some advice about it?

Thanks,
Martin Psik

Strange Equity Calculation

Hi mate,

I'm using your montecarlo to feeds my NN, but I noticed strange results. For example on

54sh KJT88shhhc

with a calculator for heads-up like a pokerstove I obtain 0% win an ~25% of tie.
With your code I obtain "only 12%". So, 2 questions:

  1. Do you merge wins/draws? How?
  2. Is it your MCC for heads-up?

Btw, I like very much your code, helped me a lot for different tasks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.