forked from Element-Research/dpnn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
77 lines (64 loc) · 1.88 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
require 'torch'
require 'nn'
local _ = require 'moses'
-- create global dpnn table
dpnn = {}
dpnn.version = 2
unpack = unpack or table.unpack -- lua 5.2 compat
function dpnn.require(packagename)
assert(torch.type(packagename) == 'string')
local success, message = pcall(function() require(packagename) end)
if not success then
print("missing package "..packagename..": run 'luarocks install nnx'")
error(message)
end
end
-- for testing:
require('dpnn.test')
-- extensions to existing modules
require('dpnn.Module')
require('dpnn.Container')
require('dpnn.Sequential')
require('dpnn.ParallelTable')
require('dpnn.LookupTable')
require('dpnn.SpatialBinaryConvolution')
require('dpnn.SimpleColorTransform')
require('dpnn.PCAColorTransform')
-- extensions to existing criterions
require('dpnn.Criterion')
-- extensions to make serialization more efficient
require('dpnn.SpatialMaxPooling')
require('dpnn.SpatialConvolution')
require('dpnn.SpatialConvolutionMM')
require('dpnn.SpatialBatchNormalization')
require('dpnn.BatchNormalization')
-- decorator modules
require('dpnn.Serial')
-- modules
require('dpnn.ReverseTable')
require('dpnn.Inception')
require('dpnn.Clip')
require('dpnn.SpatialUniformCrop')
require('dpnn.SpatialGlimpse')
require('dpnn.ArgMax')
require('dpnn.CategoricalEntropy')
require('dpnn.TotalDropout')
require('dpnn.SpatialRegionDropout')
require('dpnn.FireModule')
require('dpnn.SpatialFeatNormalization')
-- Noise Contrastive Estimation
require('dpnn.NCEModule')
require('dpnn.NCECriterion')
-- REINFORCE
require('dpnn.Reinforce')
require('dpnn.ReinforceGamma')
require('dpnn.ReinforceBernoulli')
require('dpnn.ReinforceNormal')
require('dpnn.ReinforceCategorical')
-- REINFORCE criterions
require('dpnn.VRClassReward')
require('dpnn.BinaryClassReward')
-- criterions
require('dpnn.BinaryLogisticRegression')
require('dpnn.SpatialBinaryLogisticRegression')
return dpnn