aa4ae658489c919dbca4141c7498b05ac0cac6d8,slm_lab/agent/__init__.py,AgentSpace,act,#AgentSpace#Any#,148

Before Change


    def act(self, state_space):
        data_names = ("action",)
        action_v, = self.aeb_space.init_data_v(data_names)
        for agent in self.agents:
            a = agent.a
            state_a = state_space.get(a=a)
            action_a = agent.space_act(state_a)
            action_v[a, 0:len(action_a)] = action_a
        action_space, = self.aeb_space.add(data_names, (action_v,))
        return action_space

    @lab_api

After Change


            return
        self.body.memory.update(state, action, reward, next_state, done)
        loss = self.algorithm.train()
        if not np.isnan(loss):  // set for log_summary()
            self.body.loss = loss
        explore_var = self.algorithm.update()
        return loss, explore_var

    @lab_api
    def save(self, ckpt=None):
        """Save agent"""
        if util.in_eval_lab_modes():  // eval does not save new models
            return
        self.algorithm.save(ckpt=ckpt)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: kengz/SLM-Lab
Commit Name: aa4ae658489c919dbca4141c7498b05ac0cac6d8
Time: 2019-05-25
Author: kengzwl@gmail.com
File Name: slm_lab/agent/__init__.py
Class Name: AgentSpace
Method Name: act


Project Name: osmr/imgclsmob
Commit Name: e583ae1925021107a0672e5cd4f586aef3e50452
Time: 2019-03-27
Author: osemery@gmail.com
File Name: pytorch/seg_metrics.py
Class Name: PixelAccuracyMetric
Method Name: update


Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/seq2seq/model.py
Class Name: EncoderDecoderModelBase
Method Name: predict