anyscale / academy

Ray tutorials from Anyscale
https://anyscale.com
Apache License 2.0
574 stars 195 forks source link

Question about update coord in JokeRec/step in rayrllib/recsys/01-Recsys.ipynb #77

Open jamesliu opened 2 years ago

jamesliu commented 2 years ago

centers dimension is like [clusters, users], c dimension will become [users], why do we get c[item]?
For example, if we have cluster =7, users=2000, items=101, shouldn't we get c[user] instead of c[item]?

class JokeRec (gym.Env): def step(self): ...

update the coords history: agent observes its distance to each cluster "evolve"

            for i in range(len(self.coords)):
                c = self.centers[i]
                scaled_diff = abs(c[item] - rating) / 2.0
                self.coords[i] += scaled_diff ** 2.0