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 sys | |
import math | |
import random | |
def invariant_distribution(x): | |
return math.exp(- 0.5 * x ** 2 / (0.3 * 0.3)) | |
def next_state(x, dx): | |
return x + dx * (random.uniform(0.0, 1.0) - 0.5) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <time.h> | |
#include <omp.h> | |
#include <xmmintrin.h> | |
#include <pmmintrin.h> |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import time | |
import random | |
mail_str = '[email protected]' | |
password_str = 'your_password' |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys | |
import math | |
DEG2RAD = math.pi / 180.0 | |
# WGS84 | |
dLA_A = 6378137.0 # 赤道半径 |
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 numpy as np | |
import matplotlib | |
matplotlib.use('agg') | |
from pylab import * | |
def findE(x): | |
return 250.25 * (x[0] * x[0] + x[1] * x[1]) \ | |
- 449.5 * x[0] * x[1] | |
def gradE(x): |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <time.h> | |
#include <math.h> | |
#include <omp.h> | |
#define real float |
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 sys | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import theano | |
import theano.tensor as T | |
import scipy | |
rng = np.random | |
rng.seed(0) | |
class Layer(object): |
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 sys | |
import numpy as np | |
from scipy import special | |
from chainer import cuda, Function, FunctionSet, gradient_check, Variable, optimizers | |
import chainer.functions as F | |
def target(args, params): | |
return np.exp(special.gammaln(np.sum(params)) | |
- np.sum(special.gammaln(params)) | |
+ np.sum((params - 1.) * np.log(args))) |
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 tensorflow as tf | |
x = tf.placeholder(tf.float32, [None, 1]) | |
y_ = tf.placeholder(tf.float32, [None, 1]) | |
b = tf.Variable(tf.zeros([1])) | |
w = tf.Variable(tf.zeros([1, 1])) | |
y = w * x + b |
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 tensorflow as tf | |
import numpy as np | |
import matplotlib.pyplot as plt | |
mu,sigma=5.0,0.2 | |
latent_dim=2 | |
def mlp(input): | |
w1=tf.get_variable("w1", [input.get_shape()[1], 8], initializer=tf.random_normal_initializer()) | |
b1=tf.get_variable("b1", [8], initializer=tf.constant_initializer(0.1)) |
OlderNewer