1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-28 17:00:00 +02:00
This commit is contained in:
Justin Lin
2021-04-23 07:58:13 +08:00
parent 843e03ce18
commit 675a3ef519

View File

@@ -113,12 +113,12 @@ function wf_entropy(wf, x, y) =
ln(sumOfWeights) - (sumOfWeightLogWeights / sumOfWeights);
function _wf_entropy(weights, states, state_leng, sumOfWeights, sumOfWeightLogWeights, i = 0) =
i == state_leng ? [sumOfWeights, sumOfWeightLogWeights] :
let(
opt = states[i],
weight = hashmap_get(weights, opt)
)
_wf_entropy(weights, states, state_leng, sumOfWeights + weight, sumOfWeightLogWeights + weight * ln(weight), i + 1);
i == state_leng ? [sumOfWeights, sumOfWeightLogWeights] :
let(
opt = states[i],
weight = hashmap_get(weights, opt)
)
_wf_entropy(weights, states, state_leng, sumOfWeights + weight, sumOfWeightLogWeights + weight * ln(weight), i + 1);
function _replaceStatesAt(wf, x, y, states) =
let(