forked from Element-Research/dpnn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
93 lines (80 loc) · 2.29 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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.Decorator')
require('dpnn.Serial')
require('dpnn.DontCast')
require('dpnn.NaN')
require('dpnn.Profile')
-- modules
require('dpnn.PrintSize')
require('dpnn.Convert')
require('dpnn.Constant')
require('dpnn.Collapse')
require('dpnn.ZipTable')
require('dpnn.ZipTableOneToMany')
require('dpnn.CAddTensorTable')
require('dpnn.ReverseTable')
require('dpnn.Dictionary')
require('dpnn.Inception')
require('dpnn.Clip')
require('dpnn.SpatialUniformCrop')
require('dpnn.SpatialGlimpse')
require('dpnn.WhiteNoise')
require('dpnn.ArgMax')
require('dpnn.CategoricalEntropy')
require('dpnn.TotalDropout')
require('dpnn.Kmeans')
require('dpnn.OneHot')
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.ModuleCriterion')
require('dpnn.BinaryLogisticRegression')
require('dpnn.SpatialBinaryLogisticRegression')
return dpnn