Skip to content

Commit

Permalink
Added option to choose power of AE objective
Browse files Browse the repository at this point in the history
Co-authored-by: eelregit [email protected]
  • Loading branch information
MrUrq committed Mar 12, 2020
1 parent 43ee1d8 commit c80193e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions docs/src/man/lhcoptim.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ algorithm. The objective function is the inverse of the Audze-Eglais function de
This package maximises the inverse of the Audze-Eglais objective function.


where ``L^2_{pq}`` is the Euclidean norm. It is also possible to choose power other than 2
using the `ae_power` optional parameter.
!!! note

Large integer powers can cause overflow leading to the Audze-Eglais objective function to fail silently. Use floats for large powers at the cost of computational speed.
where ``L_{pq}`` is the Euclidean norm. It is also possible to choose powers other than 2
by using the `ae_power` optional parameter.


There is also an option to use a periodic version of the Audze-Eglais which reduces clustering
Expand Down
6 changes: 3 additions & 3 deletions src/AudzeEglaisObjective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
n,d = size(LHC)
dist = 0.0

# Squared l-2 norm of distances between all (unique) points
#l-2 norm of distances between all (unique) points to the power of ae_power
for i = 2:n
for j = 1:i-1
dist_tmp = 0.0
Expand All @@ -13,9 +13,9 @@
else
@inbounds dist_comp = LHC[i,k]-LHC[j,k]
end
dist_tmp += dist_comp^ae_power
dist_tmp += dist_comp^2
end
dist += 1/dist_tmp
dist += 1/dist_tmp^(ae_power/2)
end
end
output = 1/dist
Expand Down

0 comments on commit c80193e

Please sign in to comment.