-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
exports_constraints.ts
51 lines (47 loc) · 1.49 KB
/
exports_constraints.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
// tslint:disable-next-line:max-line-length
import {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';
/**
* MaxNorm weight constraint.
*
* Constrains the weights incident to each hidden unit
* to have a norm less than or equal to a desired value.
*
* References
* - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting
* Srivastava, Hinton, et al.
* 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)
*
* @doc {heading: 'Constraints',namespace: 'constraints'}
*/
export function maxNorm(args: MaxNormArgs): Constraint {
return new MaxNorm(args);
}
/**
* Constrains the weights incident to each hidden unit to have unit norm.
*
* @doc {heading: 'Constraints', namespace: 'constraints'}
*/
export function unitNorm(args: UnitNormArgs): Constraint {
return new UnitNorm(args);
}
/**
* Constrains the weight to be non-negative.
*
* @doc {heading: 'Constraints', namespace: 'constraints'}
*/
export function nonNeg(): Constraint {
return new NonNeg();
}
/** @doc {heading: 'Constraints', namespace: 'constraints'} */
export function minMaxNorm(config: MinMaxNormArgs): Constraint {
return new MinMaxNorm(config);
}