CleanDiffuserTeam / CleanDiffuser

CleanDiffuser: An Easy-to-use Modularized Library for Diffusion Models in Decision Making
Apache License 2.0
184 stars 16 forks source link

Better results saving #6

Open CH4ACKO3 opened 2 weeks ago

CH4ACKO3 commented 2 weeks ago

Summary Added a few lines of new code for better results saving to all RL pipelines.

Description

  1. Added a "_savename" argument, defaulting to "test". Appended a directory named "_savename" to the "_savepath".
  2. Now avoids overwriting previous results (unless "_savename" is unspecified), preventing prior results being blown away, good for health.
  3. Added an "_output_tofile" argument, defaulting to "False". When set to true, redirects stdout and stderr to "_savepath/log.txt". Useful for multi-processing or background execution.
ZibinDong commented 1 week ago

Thank you for your contribution. The algorithms in pipelines primarily serve as demonstrations of CleanDiffuser's usage. Therefore, rather than focusing on convenience, we prioritize code readability. Your code introduces many additional if-else code lines, which can increase the reading complexity. However, the features you proposed, such as overwrite avoiding and stdout redirection, are essential functionalities. I will create a Logger class based on your requirements and code examples to implement these features lightweight and concisely. I will not close this pull request until this class is completed.