Skip to content

Commit 5547beb

Browse files
committed
tsc errors
1 parent ee43706 commit 5547beb

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

libs/web-flow-executor/src/nodes/neural-network-utils/activation-functions.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ function softmax(logits: number[]): number[] {
1212
return expValues.map((v) => v / sumExp);
1313
}
1414

15-
function categoricalCrossentropy(yTrue: number[], yPred: number[]): number {
16-
const epsilon = 1e-9;
17-
return -yTrue.reduce(
18-
(sum, yi, i) => sum + yi * Math.log(yPred[i] + epsilon),
19-
0
20-
);
21-
}
15+
// function categoricalCrossentropy(yTrue: number[], yPred: number[]): number {
16+
// const epsilon = 1e-9;
17+
// return -yTrue.reduce(
18+
// (sum, yi, i) => sum + yi * Math.log(yPred[i] + epsilon),
19+
// 0
20+
// );
21+
// }
2222

23-
function categoricalCrossentropyDerivative(
24-
yTrue: number[],
25-
yPred: number[]
26-
): number[] {
27-
return yPred.map((yp, i) => yp - yTrue[i]);
28-
}
23+
// function categoricalCrossentropyDerivative(
24+
// yTrue: number[],
25+
// yPred: number[]
26+
// ): number[] {
27+
// return yPred.map((yp, i) => yp - yTrue[i]);
28+
// }
2929

3030
export type ActivationFunctionType = 'relu' | 'sigmoid' | 'softmax';
3131
export function deriviateActivationFunction(

libs/web-flow-executor/src/nodes/neural-node-hidden-layer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ export const getNeuralNodeHiddenLayerNode: NodeTaskFactory<NodeInfo> = (
152152

153153
// - run sum through activation function
154154
// - send activation value to next layers multiplied by wieght per layer
155-
const activationValue = activationFunction(activationFunctionType, sum); // RELU
155+
const activationValue = activationFunction(
156+
activationFunctionType,
157+
sum,
158+
[],
159+
0
160+
); // RELU
156161

157162
hiddenNodeOutputs.push(activationValue);
158163

0 commit comments

Comments
 (0)