a776728ed39a5ee9b3f3ad84fa2e76c1c5717277,examples/reinforcement_learning/tutorial_AC.py,Actor,save,#Actor#,117

Before Change


        return tl.rein.choice_action_by_probs(_probs.ravel())  // sample according to probability distribution

    def save(self):  // save trained weights
        if not os.path.exists(os.path.join("model", "ac")):
            os.makedirs(os.path.join("model", "ac"))
        tl.files.save_npz(self.model.trainable_weights, name=os.path.join("model", "ac", "model_actor.npz"))

    def load(self):  // load trained weights
        tl.files.load_and_assign_npz(name=os.path.join("model", "ac", "model_actor.npz"), network=self.model)

After Change


        return tl.rein.choice_action_by_probs(_probs.ravel())  // sample according to probability distribution

    def save(self):  // save trained weights
        path = os.path.join("model", "_".join([ALG_NAME, ENV_ID]))
        if not os.path.exists(path):
            os.makedirs(path)
        tl.files.save_npz(self.model.trainable_weights, name=os.path.join(path, "model_actor.npz"))

    def load(self):  // load trained weights
        path = os.path.join("model", "_".join([ALG_NAME, ENV_ID]))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 15

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: a776728ed39a5ee9b3f3ad84fa2e76c1c5717277
Time: 2020-02-07
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_AC.py
Class Name: Actor
Method Name: save


Project Name: tensorlayer/tensorlayer
Commit Name: a776728ed39a5ee9b3f3ad84fa2e76c1c5717277
Time: 2020-02-07
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_PG.py
Class Name: PolicyGradient
Method Name: save


Project Name: tensorlayer/tensorlayer
Commit Name: a776728ed39a5ee9b3f3ad84fa2e76c1c5717277
Time: 2020-02-07
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_AC.py
Class Name: Actor
Method Name: save


Project Name: tensorlayer/tensorlayer
Commit Name: a776728ed39a5ee9b3f3ad84fa2e76c1c5717277
Time: 2020-02-07
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_A3C.py
Class Name: ACNet
Method Name: save


Project Name: tensorlayer/tensorlayer
Commit Name: a776728ed39a5ee9b3f3ad84fa2e76c1c5717277
Time: 2020-02-07
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_AC.py
Class Name: Critic
Method Name: save