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 scipy as sp | |
import xgboost as xgb | |
from hyperopt import hp, fmin, tpe | |
from sklearn import datasets | |
from sklearn import cross_validation | |
from sklearn.metrics import confusion_matrix | |
np.random.seed(71) | |
iris = datasets.load_iris() |
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
require 'nn' | |
torch.setdefaulttensortype("torch.FloatTensor") | |
upconv = nn.SpatialFullConvolution(1, 1, 2, 2, 2, 2, 0, 0) | |
input = torch.Tensor({{1, 10},{100, 1000}}):reshape(1, 1, 2, 2) -- (batch_size, input_dim, height, width) | |
weight = torch.Tensor({{1, 2}, {3, 4}}) -- 1x1x2x2 filter | |
bias = torch.Tensor({0.5}) | |
upconv.weight:copy(weight) | |
upconv.bias:copy(bias) |
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
name: "srcnn" | |
layer { | |
name: "input" | |
type: "Input" | |
top: "input" | |
input_param { shape: { dim: 1 dim: 3 dim: 32 dim: 32 } } | |
} | |
layer { | |
name: "conv1_layer" | |
type: "Convolution" |
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
// __attribute__((aligned(16))) float input[n], weight[n]; | |
float dot_sse(float *input, float *weight, int n) | |
{ | |
__attribute__((aligned(16))) float mm[4] = {0}; | |
__m128 x, u; | |
int pk_lp = (n & 0xfffffffc); | |
int i; | |
float sum = 0; | |
u = _mm_setzero_ps(); | |
for (i = 0; i < pk_lp; i += 4) { |
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
require 'cutorch' | |
require 'cunn' | |
require 'cudnn' | |
require 'sys' | |
-- WINOGRAD benchmark | |
-- required: cuDNN v5, cudnn.torch R5 branch | |
function create_model(ch) -- simple 3x3 conv model | |
local model = nn.Sequential() |
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
require 'cutorch' | |
require 'cunn' | |
require 'cudnn' | |
require 'sys' | |
-- WINOGRAD benchmark | |
-- required: cuDNN v5, cudnn.torch R5 branch | |
function create_model(ch) | |
local model = nn.Sequential() |
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
require 'nn' | |
local N = 1000 | |
local FEAT = 64 | |
local S = 2 | |
function nn.SpatialConvolution:reset() | |
self.weight:uniform(0, 1) | |
self.bias:zero() | |
end |
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
/* | |
* L4D2特殊感染者BOTのプレイスタイルをカスタマイズする実験的なプラグイン | |
* | |
* 出現する特殊感染者BOTの2/3のだけ改変します | |
* | |
* キー入力をシミュレートすることでBOTを操作するため | |
* システムはデフォルトのまま!! | |
* | |
* addons/sourcemod/scripting | |
* において |
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
# pip3 install tornado pubnub python-dateutil | |
# python3 -u sfd.py | tee sfd.log | |
from multiprocessing import Process, Value, Lock, Event | |
from datetime import datetime | |
import dateutil.parser | |
from pubnub.callbacks import SubscribeCallback | |
from pubnub.enums import PNStatusCategory | |
from pubnub.pnconfiguration import PNConfiguration | |
from pubnub.pubnub_tornado import PubNubTornado | |
from pubnub.pnconfiguration import PNReconnectionPolicy |
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 websocket | |
import json | |
from pprint import pprint | |
def on_message(ws, message): | |
message = json.loads(message) | |
pprint(message) | |
def on_error(ws, error): | |
print(error) |