Skip to content

Instantly share code, notes, and snippets.

View syuntoku14's full-sized avatar

Toshinori Kitamura syuntoku14

  • The University of Tokyo
View GitHub Profile
@syuntoku14
syuntoku14 / MountainCar.py
Created April 27, 2018 15:44
Q-Learning by Open ai gym
import gym
from gym import wrappers
import numpy as np
import matplotlib.pyplot as plt
"""
For practicing reinforcement learning
observation:
(position,velocity)
@syuntoku14
syuntoku14 / CartPole-Q_Learning.ipynb
Created May 9, 2018 14:23
OpenAI gym CartPole learned by Q-Learning
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@syuntoku14
syuntoku14 / md2html.bash
Last active May 31, 2018 15:39
change md to html (set the variable 'today' if you want to create today's md)
#!/usr/bin/env bash
function _func_create_md(){
kyo=`date +%y%m%d`
kyo_md="${kyo}.md"
if ! [ -e "${kyo_md}" ]; then
: > "${kyo_md}"
fi
}
@syuntoku14
syuntoku14 / swms2urdf.bash
Last active June 22, 2018 02:24
Solidworksの質量特性をURDF形式にして表示するスクリプト
#!/usr/bin/env bash
mass=`grep ^質量 "$1" | sed -e "s/[^0-9.]//g"`
echo "<mass value=\"$mass\"/>"
# extract ixx, ixy, ixz
temp=`grep Ixx "$1" | sed -e "s/[a-z = A-Z]//g"`
declare xx=() # declare matrix
@syuntoku14
syuntoku14 / mm_to_m.py
Last active June 9, 2022 06:39
STLファイルの単位をミリメートルからメートルに変換する
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
[summary]
mm 単位になっているstlファイルを m 単位に変換する
[description]
python mm_to_m.py sample.stl
のように実行すると、sample_m.stlという名前の m 単位に変換したファイルを保存する。
@syuntoku14
syuntoku14 / prediction_step.m
Last active July 3, 2018 09:14
Prediction step of Kalman Filter
% Simulation of Kalman_Filter
% In this script, error_ellipse function is used. Please download here:
% https://www.mathworks.com/matlabcentral/fileexchange/4705-error-ellipse
clear; close all;
fig = figure;
hold on;
% Initial State
x0 = [0, 0].';
@syuntoku14
syuntoku14 / kalman_filter.m
Last active June 30, 2018 01:21
Kalman Filter program with Matlab
% Simulation of Kalman_Filter
% In this script, error_ellipse function is used. Please download here:
% https://www.mathworks.com/matlabcentral/fileexchange/4705-error-ellipse
clear; close all;
fig = figure;
hold on;
% Initial State
x0 = [0, 0].';
@syuntoku14
syuntoku14 / build_env_colab.sh
Last active February 24, 2020 07:45
Install marlo environment on the google colab
# after run sh 'build_env_colab.sh', run
# import sys
# sys.path.append('/usr/local/lib/python3.6/site-packages/')
# in the python.
# To run the gym in server, pyvirtualdisplay is the best solution
# see https://qiita.com/ikeyasu/items/ec3c88ce13a2d5e41f26
# install anaconda
wget https://repo.anaconda.com/archive/Anaconda3-5.1.0-Linux-x86_64.sh
@syuntoku14
syuntoku14 / build_gym_colab.sh
Created November 14, 2018 05:39
Install gym environment into google colab
apt update
apt install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig
pip3 install pyvirtualdisplay piglet gym torch torchvision
pip3 install "gym[atari]"
@syuntoku14
syuntoku14 / dqn_atari_colab.ipynb
Last active December 31, 2023 12:51
DQN Implementation on google colab
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.