Skip to content

Commit b82c772

Browse files
committed
still debugging
1 parent 46b8970 commit b82c772

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/ApproxConv.jl

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,35 +126,32 @@ end
126126
Control the amount of entropy to add to null-hypothesis in multihypo case.
127127
128128
Notes:
129-
- Currently only supports Euclidean domains. (TODO expand)
129+
- FIXME, Currently only supports Euclidean domains.
130130
"""
131131
function calcVariableDistanceExpectedFractional(ccwl::CommonConvWrapper,
132132
sfidx::Int,
133133
certainidx::Vector{Int};
134134
kappa::Float64=3.0 )
135135
#
136-
@assert !(sfidx in certainidx) "null hypo distance does not work for sfidx in certainidx"
136+
if sfidx in certainidx
137+
return kappa*maximum(Statistics.std(ccwl.params[sfidx], dims=2))
138+
end
139+
# @assert !(sfidx in certainidx) "null hypo distance does not work for sfidx in certainidx"
140+
137141
# get mean of all fractional variables
138142
uncertainidx = setdiff(1:length(ccwl.params), certainidx)
139143
uncMeans = zeros(size(ccwl.params[sfidx],1), length(uncertainidx))
140144
dists = zeros(length(uncertainidx)+length(certainidx))
141145
dims = size(ccwl.params[sfidx],1)
142-
# uncDev = zeros(Int, length(uncertainidx))
143146
count = 0
144147
for i in uncertainidx
145148
count += 1
146-
# @show "MARK", i, size(uncMeans), size(Statistics.mean(ccwl.params[i], dims=2) ), length(ccwl.params)
147149
uncMeans[:,count] = Statistics.mean(ccwl.params[i], dims=2)[:]
148-
# uncDev[i] = Statistics.std(ccwl.params[i], dims=2)
149150
end
150151
count = 0
151152
refMean = Statistics.mean(ccwl.params[sfidx], dims=2)[:]
152153
for i in uncertainidx
153-
# if i == sfidx
154-
# continue
155-
# end
156154
count += 1
157-
# @show i, sfidx, count, size(uncMeans), size(uncMeans)
158155
dists[count] = norm(refMean - uncMeans[:,count])
159156
end
160157
# also check distance to certainidx for general scale reference (workaround heuristic)
@@ -165,7 +162,6 @@ function calcVariableDistanceExpectedFractional(ccwl::CommonConvWrapper,
165162
end
166163

167164
push!(dists, 1e-2)
168-
# @show round.(dists, digits=4)
169165
return kappa*maximum(dists)
170166
end
171167

@@ -211,17 +207,10 @@ function computeAcrossHypothesis!(ccwl::CommonConvWrapper{T},
211207
spreadDist = calcVariableDistanceExpectedFractional(ccwl, sfidx, certainidx, kappa=spreadNH)
212208
ENT = generateNullhypoEntropy(addEntr, maxlen, spreadDist)
213209
# add 1σ "noise" level to max distance as control
214-
# NOTE not around mean
215-
# meanVal = Statistics.mean(addEntr, dims=2)
216-
# addEntr .= rand(ENT, size(addEntr,2))
217210
for i in 1:size(addEntr, 1)
218211
for j in 1:size(addEntr,2)
219212
addEntr[i,j] = maniAddOps[i](addEntr[i,j], spreadDist*(rand()-0.5))
220213
end
221-
# FIXME should be on manifold
222-
# addEntr[i,:] .+= (spreadDist*rand(size(addEntr,2)) .- 0.5*spreadDist)
223-
# NOTE previous around mean approach
224-
# addEntr[i,:] .+= meanVal[i,1]
225214
end
226215
@assert addEntr[1,1] == ccwl.params[sfidx][1, allelements[count][1]] "bad view memory"
227216
else

0 commit comments

Comments
 (0)