e60511acbc04af7b91fc41c903bf88d31c669d65,reagent/gym/agents/post_step.py,,train_with_replay_buffer_post_step,#Any#Any#Any#Any#Any#Any#Any#,21

Before Change


        size_req = max(size_req, replay_burnin)

    if trainer_preprocessor is None:
        sig = inspect.signature(trainer.train)
        logger.info(f"Deriving trainer_preprocessor from {sig.parameters}")
        // Assuming training_batch is in the first position (excluding self)
        assert (
            list(sig.parameters.keys())[0] == "training_batch"
        ), f"{sig.parameters} doesn"t have training batch in first position."
        training_batch_type = sig.parameters["training_batch"].annotation
        assert training_batch_type != inspect.Parameter.empty
        if not hasattr(training_batch_type, "from_replay_buffer"):
            raise NotImplementedError(
                f"{training_batch_type} does not implement from_replay_buffer"
            )

        def trainer_preprocessor(batch):
            retval = training_batch_type.from_replay_buffer(batch)
            if device is not None:
                retval = retval.to(device)

After Change


    if replay_burnin is not None:
        size_req = max(size_req, replay_burnin)

    if trainer_preprocessor is None:
        trainer_preprocessor = make_replay_buffer_trainer_preprocessor(trainer, device)

    def post_step(
        obs: np.ndarray,
        actor_output: rlt.ActorOutput,
        reward: float,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/Horizon
Commit Name: e60511acbc04af7b91fc41c903bf88d31c669d65
Time: 2020-05-06
Author: kaiwenw@fb.com
File Name: reagent/gym/agents/post_step.py
Class Name:
Method Name: train_with_replay_buffer_post_step


Project Name: mozilla/TTS
Commit Name: 9cef923d991f57b697f749295dc242e5c745ed1e
Time: 2020-10-28
Author: erogol@hotmail.com
File Name: TTS/tts/layers/losses.py
Class Name: DifferentailSpectralLoss
Method Name: forward


Project Name: allenai/allennlp
Commit Name: 700abc65fd2172a2c6809dd9b72cf50fc2407772
Time: 2020-02-03
Author: mattg@allenai.org
File Name: allennlp/common/from_params.py
Class Name:
Method Name: create_kwargs