facebookresearch / Pearl

A Production-ready Reinforcement Learning AI Agent Library brought by the Applied Reinforcement Learning team at Meta.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in tutorial single item recommender system: can't instantiate abstract class RecEnv

milmin opened this issue · comments

In the tutorial single_item_recommender_system.ipynb when calling RecEnv(list(actions.values())[:100], model, history_length) I get

TypeError: Can't instantiate abstract class RecEnv with abstract method observation_space

Since RecEnv inherits from class Environment which has abstract method observation_space a solution is to override it in RecEnv with something like:

def observation_space(self):
    pass

In this tutorial, having an empty observation space is that wanted?

Thank you for reporting. This should be fixed now.

Since RecEnv inherits from class Environment which has abstract method observation_space a solution is to override it in RecEnv with something like:

def observation_space(self):
    pass

In this tutorial, having an empty observation space is that wanted?

In this example, the observations are the obtained reward, which has a range from 0 to 1, so the observation space is a Box from 0 to 1. This has been included in our latest commit. Thank you.