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
# Custom model | |
#--------------------------------------------------------------------------------- | |
class CustomActorCritic(nn.Module): | |
def __init__(self, input_dim, control_dim, hidden_dim, safety_dim, Num_Hidden_Shared, Num_Hidden_Control, Num_Hidden_Safety, std=0.0): | |
super(CustomActorCritic, self).__init__() | |
layers_shared_actor = [] | |
layers_safety_actor = [] | |
layers_control_actor = [] |
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 gym | |
import gym_four | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import seaborn as sns | |
''' | |
To change in step() of grid world | |
''' |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
def Reduced_data_set(dataset,final_dimension, plot = False): | |
''' | |
This function is used to perform pca | |
and retain final_dimension number of | |
principle component from our dataset | |
''' | |
# Centering all the features to zero mean | |
Mean_of_data=dataset.mean(0) | |
centered_data=dataset-Mean_of_data |