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 pandas as pd | |
class MyDF(pd.DataFrame): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.definition = 'my_definition' | |
my_df = MyDF() | |
my_df.__dict__ = df.__dict__.copy() | |
print(len(my_df)) | |
print(my_df.definition) |
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 json | |
from keras.models import model_from_json | |
def convert_to_inference_model(original_model): | |
original_model_json = original_model.to_json() | |
inference_model_dict = json.loads(original_model_json) | |
layers = inference_model_dict['config'] | |
for layer in layers: | |
if 'stateful' in layer['config']: |
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
tch_size += direction | |
if training_config.batch_size < 1: | |
direction *= -1 | |
previous_epoch_time = current_epoch_time | |
file_name = 'model_epoch_{:04}.h5'.format(epoch) | |
history_file_name = 'model_history.pickle' | |
try: | |
if 'linux' in sys |
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 csv | |
import numpy as np | |
from task import Task | |
from agents.agent import DDPG | |
from plot_functions import plot_results | |
from collections import defaultdict | |
import copy | |
import matplotlib.pyplot as plt |
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
from pid import PID | |
from lowpass import LowPassFilter | |
from yaw_controller import YawController | |
import rospy | |
import pickle | |
import copy | |
import os | |
controller_log_time_seconds = 5 | |
controller_log_file_base = '/home/student/shared_vm/controller_id_log_' |
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 pickle | |
import numpy as np | |
import matplotlib.pyplot as plt | |
server_log_filename = 'C:\workspace\shared_vm\server_pid_log_0.pkl' | |
with open(server_log_filename, 'rb') as f: | |
log = pickle.load(f) |