Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from RainerEngelken/master
Browse files Browse the repository at this point in the history
fig beautification + bugfix: i1d, maxi undefined
  • Loading branch information
SimonDanisch authored Dec 16, 2017
2 parents 38125d9 + 81b51df commit caaafac
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docs/src/Poincare/poincare.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ function poincare_inner{N}(rv, result, c, π, ::Val{N}, n)
# save state of neuron 2 and 3
x = Cuint(max(round(((ϕ₂ + πh) / π) * (Float32(n) - 1f0)) + 1f0, 1f0))
y = Cuint(max(round(((ϕ₃ + πh) / π) * (Float32(n) - 1f0)) + 1f0, 1f0))
accum = result[x, y]
# this is unsafe, since it could read + write from different threads, but good enough for the stochastic kind of process we're doing
result[i1d] = accum + 1f0
i1d = GPUArrays.gpu_sub2ind((n, n), (x, y))
@inbounds if i1d <= Cuint(n * n) && i1d > Cuint(0)
accum = result[i1d]
# this is unsafe, since it could read + write from different threads, but good enough for the stochastic kind of process we're doing
result[i1d] = accum + 1f0
end
continue
end
else
Expand Down Expand Up @@ -70,15 +73,10 @@ cmap = interpolate(([

cn = length(cmap)
resultcpu = Array(result)
extrema(log.(resultcpu))

img_color = map(resultcpu) do val
val = maxi - val
if val 0.0
val = 0.01
end
val = log(val)
val = clamp(val, 0f0, 1f0);
val = log(1.0 + log(1.0 + val))
val = clamp(1.0 - val, 0f0, 1f0);
idx = (val * (cn - 1)) + 1.0
RGB{N0f8}(cmap[idx])
end
Expand Down

0 comments on commit caaafac

Please sign in to comment.