-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add exponential distribution #513
Conversation
Failed to generate code suggestions for PR |
@@ -0,0 +1,63 @@ | |||
import { Graph } from '../../../../src/graph/graph.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also spelt incorrectly
|
||
constructor(props: INodeDefinition) { | ||
super(props); | ||
this.addInput('value', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very weird and unintuitive.
The formula for exponential decay is generally y(x)= Pe^(-kx)
With P the initial starting value and k the decay factor
In this calculation we are removing P and and just calculating this over the fixed domain o - length
Then when we do the reweighting we just get a function where the sum of the points equals this value over the range
Is there a reason why we really want this over a standard decay without the rebalancing?
const { value, length, decay, precision } = this.getAllInputs(); | ||
|
||
// Calculate weights using exponential decay | ||
const weights = Array.from({ length: length }, (_, i) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do this and the total weighting in a single reduce call instead of 2 iterations of the array
🦋 Changeset detectedLatest commit: f1612a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
No description provided.