mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-28 08:50:30 +02:00
format
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user