How to use the pot.Pot function in POT

To help you get started, we’ve selected a few POT examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyGBot / pyGBot / trunk / pyGBot / Plugins / games / pokerfiles / tourney.py View on Github external
# subtract trigger amount from other active action
                    for o in active:
                        seat = o.hand.seat
                        self.pots[-1].players.append(o)
                        self.pots[-1].value += amt
                        action[seat] -= amt

            # Add leftovers to the first pot
            for amt in action:
                self.pots[0].value += amt

            self.pots.reverse()

        else:
            self.pots.append(Pot())
            self.pots[0].value = self.pot
            self.pots[0].players = self.activeplayers()
github tolstikhin / adagan / pot.py View on Github external
"""Build a TensorFlow graph with all the necessary ops.

        """
        assert False, 'POT base class has no build_model method defined.'

    def _train_internal(self, opts):
        assert False, 'POT base class has no train method defined.'

    def _sample_internal(self, opts, num):
        assert False, 'POT base class has no sample method defined.'

    def _train_mixture_discriminator_internal(self, opts, fake_images):
        assert False, 'POT base class has no mixture discriminator method defined.'


class ImagePot(Pot):
    """A simple POT implementation, suitable for pictures.

    """

    def __init__(self, opts, data, weights):

        # One more placeholder for batch norm
        self._is_training_ph = None
        Pot.__init__(self, opts, data, weights)


    def dcgan_like_arch(self, opts, noise, is_training, reuse, keep_prob):
        output_shape = self._data.data_shape
        num_units = opts['g_num_filters']

        batch_size = tf.shape(noise)[0]
github pyGBot / pyGBot / trunk / pyGBot / Plugins / games / pokerfiles / tourney.py View on Github external
for seat in xrange(len(self.players)):
                action.append(self.players[seat].inplay)

            active = self.activeplayers()
            active.sort(Player.actionsort)

            while len(active):
                p = active.pop(0)
                seat = p.hand.seat
                if action[seat]:

                    # get trigger amount
                    amt = action[seat]

                    # add a new pot, setting the trigger
                    self.pots.append(Pot(amt))

                    # add current player to pot
                    self.pots[-1].players.append(p)

                    # add trigger amount to pot
                    self.pots[-1].value += amt

                    # subtract trigger amount from trigger's action
                    action[seat] -= amt

                    # subtract trigger amount from other active action
                    for o in active:
                        seat = o.hand.seat
                        self.pots[-1].players.append(o)
                        self.pots[-1].value += amt
                        action[seat] -= amt
github pyGBot / pyGBot / pyGBot / Plugins / games / pokerfiles / tourney.py View on Github external
for seat in xrange(len(self.players)):
                action.append(self.players[seat].inplay)

            active = self.activeplayers()
            active.sort(Player.actionsort)

            while len(active):
                p = active.pop(0)
                seat = p.hand.seat
                if action[seat]:

                    # get trigger amount
                    amt = action[seat]

                    # add a new pot, setting the trigger
                    self.pots.append(Pot(amt))

                    # add current player to pot
                    self.pots[-1].players.append(p)

                    # add trigger amount to pot
                    self.pots[-1].value += amt

                    # subtract trigger amount from trigger's action
                    action[seat] -= amt

                    # subtract trigger amount from other active action
                    for o in active:
                        seat = o.hand.seat
                        self.pots[-1].players.append(o)
                        self.pots[-1].value += amt
                        action[seat] -= amt
github pyGBot / pyGBot / pyGBot / Plugins / games / pokerfiles / tourney.py View on Github external
# subtract trigger amount from other active action
                    for o in active:
                        seat = o.hand.seat
                        self.pots[-1].players.append(o)
                        self.pots[-1].value += amt
                        action[seat] -= amt

            # Add leftovers to the first pot
            for amt in action:
                self.pots[0].value += amt

            self.pots.reverse()

        else:
            self.pots.append(Pot())
            self.pots[0].value = self.pot
            self.pots[0].players = self.activeplayers()

POT

Python Optimal Transport Library

MIT
Latest version published 1 day ago

Package Health Score

84 / 100
Full package analysis