-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNnwEstimator.lua
36 lines (27 loc) · 987 Bytes
/
NnwEstimator.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
-- NnwEstimator.lua
-- parent class for all NnwEstimator classes
require 'affirm'
require 'makeVerbose'
require 'verify'
-- API overview
if false then
e = NnwEstimator(xs, ys)
-- all methods are supplied by a subclass
end -- API overview
--------------------------------------------------------------------------------
-- Constructor
--------------------------------------------------------------------------------
torch.class('NnwEstimator')
function NnwEstimator:__init(xs, ys)
local v, isVerbose = makeVerbose(false, 'NnwEstimator:__init')
verify(v, isVerbose,
{{xs, 'xs', 'isTensor2D'},
{ys, 'ys', 'isTensor1D'}})
assert(xs:size(1) == ys:size(1))
self._xs = xs
self._ys = ys
self._selected = torch.Tensor(xs:size(1)):fill(1)
end -- __init()
--------------------------------------------------------------------------------
-- PUBLIC METHODS: (NONE)
--------------------------------------------------------------------------------