Commit b3f0bebf authored by Ibrahim's avatar Ibrahim
Browse files

added octorotor and commonml submodules

parent d8794b87
Loading
Loading
Loading
Loading

.gitmodules

0 → 100644
+6 −0
Changes for .gitmodules: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
[submodule "commonml"]
	path = commonml
	url = git@git.isis.vanderbilt.edu:ahmedi/commonml.git
[submodule "systems/octorotor"]
	path = systems/octorotor
	url = git@git.isis.vanderbilt.edu:ahmedi/gym-octorotor.git
Changes for commonml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
Subproject commit b702383cd3b00173f9db5990b6d5ae451d24a371
+4 −8
Changes for meta.py: 4 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ from sklearn.base import BaseEstimator

import torch
from torch.optim.lr_scheduler import CosineAnnealingLR
from higher import innerloop_ctx
import numpy as np
from tqdm.auto import tqdm, trange
import matplotlib.pyplot as plt
@@ -15,8 +14,8 @@ from sklearn import cluster
from sklearn.neural_network import MLPRegressor
from scipy.spatial.distance import jensenshannon, cosine, euclidean

from utils import copy_mlp_regressor, copy_tensor, higher_dummy_context, get_gradients
from ppo import PPO, Memory, DEVICE, returns
from utils import copy_mlp_regressor, copy_tensor, get_gradients
from ppo import PPO, Memory, DEVICE



@@ -257,13 +256,10 @@ def rank_library(library, agent, memory):
    vals = []
    for params in library:
        agent.policy.load_state_dict(params)
        # TODO: logp is p of taking action from state,
        # shouldnt we multiply logp of (state-1, action-1) with the value
        # of state to get the weighed value of each state in sequence times
        # the likelihood of that state?
        logp, _, _ = agent.policy.evaluate(states, actions)
        p = torch.exp(logp)
        vals.append(torch.sum(p * returns).item())
        # multiply probability of action reaching that state with value of state
        vals.append(torch.sum(p[:-1] * returns[1:]).item())
    agent.policy.load_state_dict(og_params)
    return np.argsort(vals)[::-1], np.asarray(vals)

+0 −2
Changes for ppo.py: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@ import gym
import numpy as np
from tqdm.auto import trange

from utils import higher_dummy_context

# pylint: disable=no-member
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

rl/__init__.py

deleted100644 → 0
+0 −0

Empty file deleted.

Loading