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
-- Available torch7 pre-trained models for download | |
Alexnet (trained by me) | |
cudnn: https://ln.sync.com/dl/3d9c28e80#cvjp4mjs-mc2y8jrt-9wq5yebx-yrdchcei | |
mean = {0.48037518790839, 0.45039056120456, 0.39922636057037} | |
std = {0.27660147027775, 0.26883440068399, 0.28014687231841} | |
img size: 3x224x224 | |
overfeat: https://github.com/jhjin/overfeat-torch | |
mean = {118.380948, 118.380948, 118.380948} |
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 mysplit(inputstr, sep) | |
-- split strings by any type of separator | |
if sep == nil then | |
sep = "%s" | |
end | |
local t={} ; i=1 | |
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do | |
t[i] = str | |
i = i + 1 | |
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
m.updateGradInput = function(self,i,o) end -- for the gradInput | |
m.accGradParameters = function(self,i,o) end -- for freezing the parameters |
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' | |
-- you just need to provide the linear module you want to convert, | |
-- and the dimensions of the field of view of the linear layer | |
function convertLinear2Conv1x1(linmodule,in_size) | |
--[[ | |
Convert Linear modules to convolution modules. | |
Arguments |
NewerOlder