Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### INIT CODE - DO NOT CHANGE ### | |
from pyjop import * | |
from types import SimpleNamespace | |
SimEnv.connect() | |
editor = LevelEditor.first() | |
data = SimpleNamespace() # use this to share mutable data between your function calls | |
### END INIT CODE ### | |
### IMPORTS - Add your imports here ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mostly from https://github.com/Finspire13/pytorch-policy-gradient-example/blob/master/pg.py | |
import time | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.distributions import Bernoulli | |
from torch.autograd import Variable | |
from itertools import count | |
import matplotlib.pyplot as plt |