这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Trinkle23897
Copy link
Collaborator

close #390

@Trinkle23897 Trinkle23897 force-pushed the 390-add-env_id-in-preprocess_fn branch from 54916a5 to 92e8441 Compare July 2, 2021 13:35
@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2021

Codecov Report

Merging #391 (5759673) into master (ebaca6f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #391   +/-   ##
=======================================
  Coverage   94.65%   94.65%           
=======================================
  Files          57       57           
  Lines        3758     3758           
=======================================
  Hits         3557     3557           
  Misses        201      201           
Flag Coverage Δ
unittests 94.65% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tianshou/data/collector.py 95.37% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebaca6f...5759673. Read the comment docs.

Copy link

@externalsupplierstaff externalsupplierstaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also change

The "preprocess_fn" is a function called before the data has been added to the
buffer with batch format. It will receive with only "obs" when the collector resets
the environment, and will receive five keys "obs_next", "rew", "done", "info", and
"policy" in a normal env step. It returns either a dict or a
:class:~tianshou.data.Batch with the modified keys and values. Examples are in
"test/base/test_collector.py".

By

The "preprocess_fn" is a function called before the data has been added to the
buffer with batch format. It will receive only "obs" and "env_id" when the collector resets
the environment, and will receive six keys "obs_next", "rew", "done", "info", "policy" and "env_id" in a normal env step. It returns either a dict or a
:class:~tianshou.data.Batch with the modified keys and values. Examples are in
"test/base/test_collector.py".

@Trinkle23897 Trinkle23897 merged commit c198761 into thu-ml:master Jul 5, 2021
@Trinkle23897 Trinkle23897 deleted the 390-add-env_id-in-preprocess_fn branch July 5, 2021 01:50
@Trinkle23897 Trinkle23897 linked an issue Jul 5, 2021 that may be closed by this pull request
BFAnas pushed a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

preprocess_fn does not receive env index How to do self-play correctly for tic-tac-toe?

3 participants