datamllab / rlcard

Reinforcement Learning / AI Bots in Card (Poker) Games - Blackjack, Leduc, Texas, DouDizhu, Mahjong, UNO.
http://www.rlcard.org
MIT License
2.87k stars 619 forks source link

NFSP solving problem Q-Loss #319

Open emanueleiacca opened 4 months ago

emanueleiacca commented 4 months ago

Hi, i'm sorry I don't know how to make a pull request, i am a noob in git :( It has been 3 months since I'm working on RLCard for my bachelor degree thesis, rn I'm working on NFSP algorithm. I use Tensorboard to plot results and I was having problem to plot the loss, in the nfsp_agent.py code: def feed(self, ts): ''' Feed data to inner RL agent

    Args:
        ts (list): A list of 5 elements that represent the transition.
    '''
    self._rl_agent.feed(ts)
    self.total_t += 1
    if self.total_t>0 and len(self._reservoir_buffer) >= self._min_buffer_size_to_learn and self.total_t%self._train_every == 0:
        sl_loss  = self.train_sl()
        print('\rINFO - Step {}, sl-loss: {}'.format(self.total_t, sl_loss), end='')

the function doesn't return the sl_loss, so this part should be added return sl_loss return None Thank u very much for this wonderful project, I hope to help Emanuele