File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,18 @@ export class NetInput {
86
86
return this . _inputSize
87
87
}
88
88
89
+ public get relativePaddings ( ) : Point [ ] {
90
+ return Array ( this . inputs . length ) . fill ( 0 ) . map (
91
+ ( _ , batchIdx ) => this . getRelativePaddings ( batchIdx )
92
+ )
93
+ }
94
+
95
+ public get reshapedInputDimensions ( ) : Dimensions [ ] {
96
+ return Array ( this . inputs . length ) . fill ( 0 ) . map (
97
+ ( _ , batchIdx ) => this . getReshapedInputDimensions ( batchIdx )
98
+ )
99
+ }
100
+
89
101
public getInputDimensions ( batchIdx : number ) : number [ ] {
90
102
return this . _inputDimensions [ batchIdx ]
91
103
}
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import * as tf from '@tensorflow/tfjs-core';
2
2
3
3
export function leaky ( x : tf . Tensor4D ) : tf . Tensor4D {
4
4
return tf . tidy ( ( ) => {
5
- return tf . maximum ( x , tf . mul ( x , tf . scalar ( 0.10000000149011612 ) ) )
5
+ const min = tf . mul ( x , tf . scalar ( 0.10000000149011612 ) )
6
+ return tf . add ( tf . relu ( tf . sub ( x , min ) ) , min )
7
+ //return tf.maximum(x, min)
6
8
} )
7
9
}
You can’t perform that action at this time.
0 commit comments