Skip to content

Instantly share code, notes, and snippets.

View zaburo-ch's full-sized avatar
💭
😇

Kaizaburo Kido zaburo-ch

💭
😇
View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
using ll = long long;
struct State{
ll bit, c;
State(ll bit, ll c): bit(bit), c(c){}
bool operator<(const State& right ) const {
return c > right.c;
#include <iostream>
#include <cstring>
#include <memory>
using namespace std;
class A{
public:
int field[10][10];
A(){
# Keras implementation of 'Deep Embedded Clustering.'
# https://arxiv.org/abs/1511.06335
# This code doesn't work yet.
# There might be something wrong in the code of Stacked Auto-Encoder.
# Please let me know if you find any mistakes.
import numpy as np
np.random.seed(71) # for reproducibility
import numpy as np
np.random.seed(71)
import matplotlib.pyplot as plt
import Image
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.datasets import mnist
from keras.callbacks import Callback, EarlyStopping, ModelCheckpoint
#include <iostream>
#include <string>
using namespace std;
class CheckCopy {
public:
string str;
// constructor
CheckCopy(string astr){
str = astr;
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.optimizers import SGD, RMSprop
import matplotlib.pyplot as plt
from pendulum import InvertedPendulum, video
seed = 123
np.random.seed(seed)
# refered to https://searchcode.com/codesearch/view/34802371/
def update_state(self):
for i in range(self.t_num):
costheta = np.cos(self.theta)
sintheta = np.sin(self.theta)
ml = self.m * self.l
total_mass = self.M + self.m
temp = (self.u + ml * self.theta_dot**2 * sintheta) / total_mass
thetaacc = ((self.g * sintheta - costheta * temp) /
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class InvertedPendulum(object):
actions = [0, 1, 2]
M = 8.
m = 2.
l = 0.5
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.optimizers import SGD, RMSprop
from keras import backend as K
def error(y_true, y_pred):
return K.sum(K.square(y_pred - y_true), axis=-1)
import numpy as np
import chainer
from chainer import optimizers
import chainer.functions as F
import chainer.links as L
import matplotlib.pyplot as plt
class MLP(chainer.Chain):
def __init__(self):