mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-25 23:46:32 +02:00
refactor: rename
This commit is contained in:
@@ -72,10 +72,10 @@ function _wf_collapse(wf, x, y, states, weights, leng, threshold, i = 0) =
|
|||||||
// Shannon entropy
|
// Shannon entropy
|
||||||
function wf_entropy(wf, x, y) =
|
function wf_entropy(wf, x, y) =
|
||||||
let(
|
let(
|
||||||
weights = wf_weights(wf),
|
all_weights = wf_weights(wf),
|
||||||
states_weights = [for(state = wf_eigenstates_at(wf, x, y)) hashmap_get(weights, state)],
|
weights = [for(state = wf_eigenstates_at(wf, x, y)) hashmap_get(all_weights, state)],
|
||||||
sumOfWeights = sum(states_weights),
|
sumOfWeights = sum(weights),
|
||||||
sumOfWeightLogWeights = sum([for(w = states_weights) w * ln(w)])
|
sumOfWeightLogWeights = sum([for(w = weights) w * ln(w)])
|
||||||
)
|
)
|
||||||
ln(sumOfWeights) - (sumOfWeightLogWeights / sumOfWeights);
|
ln(sumOfWeights) - (sumOfWeightLogWeights / sumOfWeights);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user