This file contains hidden or 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 | |
| import statsmodels.api as sm | |
| # glow500.xls at https://www.umass.edu/statdata/statdata/data/glow/index.html | |
| xls_file = pd.ExcelFile('glow500.xls') | |
| df = xls_file.parse(header=0) | |
| rate_dummies = pd.get_dummies(df['RATERISK']) | |
| rate_dummies.columns = ['RATERISK1', 'RATERISK2', 'RATERISK3'] |
This file contains hidden or 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 <stdbool.h> | |
| #include <string.h> | |
| #define SEPCHAR '_' | |
| #define MAXLEN 32 | |
| #define BUFFSIZE 1000000 | |
| #define TOKENLEN 8 |
This file contains hidden or 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)) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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' |