takuseno / d3rlpy

An offline deep reinforcement learning library
https://takuseno.github.io/d3rlpy
MIT License
1.29k stars 230 forks source link

Prediction error #112

Closed amirmirzaeinia closed 3 years ago

amirmirzaeinia commented 3 years ago

I am trying to see the performance of the model using prediction and get this error. check the source code but there is not much clear.

from d3rlpy.algos import Algo ImportError: cannot import name 'Algo'

from d3rlpy.algos import Algo

create algorithm with saved configuration

algo = Algo.from_json('d3rlpy_logs//params.json')

ready to load

algo.load_model('d3rlpy_logs//model_100.pt')

ready to predict

algo.predict(...)

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior.

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

pstansell commented 3 years ago

You need to replace Algo with a specific valid algorithm name, for example, from d3rlpy.algos import CQL

amirmirzaeinia commented 3 years ago

I see, it was confusing. thank you

pstansell commented 3 years ago

You're welcome. Please close the issue if you're satisfied with the answer.

amirmirzaeinia commented 3 years ago

thank you for clarification, there is another issue I can see that, I have a reasonably good loss convergence in my model but it does not work well for prediction. What is the best approach to debug the model? thank you

takuseno commented 3 years ago

@amirmirzaeinia Debugging RL models is still a challenging problem. In RL, loss convergence is not meaning good performance for both online and offline. Here is the list of available metrics. https://d3rlpy.readthedocs.io/en/v0.91/references/metrics.html One easy indicator is average_value_estimation_scorer that computes the average value estimation. If this absolute value is very large, there could be an overestimation issue. https://d3rlpy.readthedocs.io/en/v0.91/references/generated/d3rlpy.metrics.scorer.average_value_estimation_scorer.html#d3rlpy.metrics.scorer.average_value_estimation_scorer

takuseno commented 3 years ago

The debugging issue is different from the original topic. So I'll close this issue. Please feel free to create a new issue about it.