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
# local-CV: 0.436 | |
# number of threads | |
nthread=8 | |
# fixed random seed | |
seed=12 | |
# whether create binary buffer for text input, this normally will speedup loading (NO) | |
use_buffer = 0 | |
# The path of training data |
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 'open-uri' | |
TARGET_URL = "http://localhost:8888/" | |
TARGET_DIR = "./" | |
CORE_FILE = "./core" | |
def random_file_update | |
rng = Random.new | |
10000.times do |i| | |
filename = File.join(TARGET_DIR, sprintf("%d", i % 10)) |
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
local function pagerank(mat, alpha, epsilon) | |
alpha = alpha or 0.85 | |
epsilon = epsilon or 1.0e-5 | |
local state = torch.Tensor(mat:size(1)):fill(1.0 / mat:size(1)) | |
local p = mat:clone() | |
local alpha_not = ((1.0 - alpha) / state:size(1)) | |
for i = 1, mat:size(1) do | |
p[i]:div(mat[i]:sum() + 1.0e-6) |
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
--- mynn.lua | |
mynn = {} -- Define your own namespace. | |
--- LeakyReLU.lua | |
-- Define LeakyReLU module under your own namespace. | |
local LeakyReLU, parent = torch.class('mynn.LeakyReLU','nn.Module') | |
function LeakyReLU:__init(negative_scale) | |
parent.__init(self) -- Call the super class constructor |
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' | |
local function build_model() | |
-- a CNN | |
local model = nn.Sequential() | |
model:add(nn.SpatialConvolutionMM(3, 128, 5, 5, 1, 1)) | |
model:add(nn.ReLU()) | |
model:add(nn.SpatialMaxPooling(2, 2, 2, 2)) | |
model:add(nn.View(10 * 10 * 128)) |
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
-- sudo luarocks install csvigo | |
-- でインストールしておく | |
require 'csvigo' | |
--[[ test.csv | |
a,b,c,d | |
1,2,3,4 | |
5,5,3,3 | |
--]] |
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 'cunn' | |
require './lib/SpatialAveragePooling' | |
-- reference: https://gist.github.com/mavenlin/e56253735ef32c3c296d | |
local function normal_init(m, u, s, bias) | |
m.weight:normal(u, s) | |
if bias == nil then | |
m.bias:normal(u, s) | |
else |
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
/* Left 4 Dead 2 Panic Events */ | |
#include <sourcemod> | |
public OnPluginStart() | |
{ | |
/* Hook Panic Create event after it has happened */ | |
HookEvent("create_panic_event", OnPanicCreate); | |
/* Hook Left Player event after it has happened */ | |
HookEvent("player_left_start_area", OnPlayerLeftStartArea); | |
} |
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
// Force strict semicolon mode | |
// bug fix by def075 | |
#pragma semicolon 1 | |
#include <sourcemod> | |
#define PLUGIN_VERSION "0.666 beta- fix" | |
new String:g_gameMode[64]; | |
new Handle:g_mapMenu = INVALID_HANDLE; |
NewerOlder