Random agent with action_space value checking
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
/* | |
Provides utility functions for checking/accessing sObject properties | |
Updates: | |
- Namespace no longer required | |
- Replaced getPopulatedFieldsAsMap() with a plain try catch to improve speed | |
- Allowed for returns of SObjects | |
- Throw out SObjectException where the field exists but wasn't queried | |
To Do: |
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
import numpy as np | |
class Discrete: | |
def __init__(self, values): | |
self.values = values | |
self.max = np.prod(self.values) | |
def __validate(self, observation): | |
for i in range(len(self.values)): |
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
Alteration to [standard hill climbing model](https://gym.openai.com/algorithms/alg_WKinUO3TNabzwPeaD7A) | |
Uses biased update that allows for worse performance to becomes new standard with reduced probability | |
For CartPole environment should result in larger percentage of tests solving the problem |
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
For part 1 of https://openai.com/requests-for-research/#cartpole | |
Quite often it doesn't solve (because of local minimum) |
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
For Section 1: https://openai.com/requests-for-research/#cartpole | |
Requirement of environment for algorithm to work: | |
- Action space has two discrete actions | |
- Ratio of observations can decide to the best action to take |
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
# CARTPOLE MULTI AGENT | |
# Set up to allow for using a pool of agents | |
import logging | |
import gym | |
from CrossEntropyMethod import CrossEntropyMethodPool | |
import gym.scoreboard.scoring | |
import gym.monitoring.monitor |
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
Unachievable score resulting from action returning 20 rather than 2 | |
Environment currently sets: velocity += (action-1)*0.001 + math.cos(3*position)*(-0.0025) without a bound checks on the input | |
Will look at adding range check to the environment |
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
import logging | |
import gym | |
from SimulatedAnnealing import SimulatedAnnealingAgent | |
def main(): | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
env = gym.make('Acrobot-v0') |
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
import logging | |
import gym | |
from SimulatedAnnealing import SimulatedAnnealingAgent | |
def main(): | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
env = gym.make('CartPole-v0') |
NewerOlder