Skip to content

Instantly share code, notes, and snippets.

View nagadomi's full-sized avatar
💭
I will be away in May-Jun.

nagadomi

💭
I will be away in May-Jun.
View GitHub Profile
import os
import subprocess
import re
class Sentence():
class Phone():
def __init__(self, begin_frame, end_frame, phone):
self.begin_frame = begin_frame
self.end_frame = end_frame
self.phone = phone
# pip3 install websocket-client
import websocket
from multiprocessing import Process, Value, Lock, Event
from datetime import datetime
import dateutil.parser
import json
from time import sleep
class SFDInfo():
def __init__(self):
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)
# 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
/*
* L4D2特殊感染者BOTのプレイスタイルをカスタマイズする実験的なプラグイン
*
* 出現する特殊感染者BOTの2/3のだけ改変します
*
* キー入力をシミュレートすることでBOTを操作するため
* システムはデフォルトのまま!!
*
* addons/sourcemod/scripting
* において
require 'nn'
local N = 1000
local FEAT = 64
local S = 2
function nn.SpatialConvolution:reset()
self.weight:uniform(0, 1)
self.bias:zero()
end
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()
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()
// __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) {
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"