9 lines
231 B
TypeScript
9 lines
231 B
TypeScript
export const exponentialDecay = ({
|
|
accumulator,
|
|
nextValue,
|
|
biasOfNextValue,
|
|
}: {
|
|
accumulator: number;
|
|
nextValue: number;
|
|
biasOfNextValue: number;
|
|
}) => accumulator * (1 - biasOfNextValue) + nextValue * biasOfNextValue;
|