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 'torch' | |
require 'nn' | |
local mytester = torch.Tester() | |
local precision = 1e-5 | |
local critest = {} | |
function critest.MSECriterion() |
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
features = nn.Sequential() | |
features:add(nn.Transpose({1,4},{1,3},{1,2})) | |
features:add(nn.SpatialConvolutionCUDA(fSize[1], fSize[2], 9, 9, 2, 2)) -- (111 - 9 + 2)/2 = 52 | |
features:add(nn.Threshold(0,1e-6)) | |
features:add(nn.SpatialMaxPoolingCUDA(2,2,2,2)) -- 26 | |
features:add(nn.SpatialConvolutionCUDA(fSize[2], fSize[3], 5, 5)) -- 22 | |
features:add(nn.Threshold(0,1e-6)) | |
features:add(nn.SpatialMaxPoolingCUDA(2,2,2,2)) -- 11 | |
features:add(nn.SpatialConvolutionCUDA(fSize[3], fSize[4], 4, 4)) -- 8 | |
features:add(nn.Threshold(0,1e-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
local tcp = require 'socket' | |
require 'sys' | |
function start() | |
while true do | |
print(os.date()) | |
local conn = tcp.connect('localhost',8483) | |
conn:send('ealasjdiasldjeladj') | |
conn:close() | |
sys.sleep(0.01) |
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 async = require 'async' | |
local http = require 'socket.http' | |
local ltn12 = require 'ltn12' | |
function start() | |
local url = 'tcp://localhost:8082/' | |
while true do | |
print(os.date()) | |
local response = {} |
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/env torch | |
require 'nn' | |
require 'image' | |
require 'xlua' | |
require 'pl' | |
opt = lapp[[ | |
-t,--threads (default 8) number of threads | |
-p,--type (default float) float or cuda |
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 'image' | |
local memTestClass = torch.class('image.memTestClass') | |
function memTestClass:__newindex__(key, value) | |
if type(key) == 'number' then | |
return 1 -- do this so that rawset isn't called anyways, stupid of me to miss this | |
else rawset(self, key, value) end | |
end | |
function testMemory() | |
n = 50000 |
NewerOlder