@@ -33,12 +33,14 @@ interface ColumnHparam {
33
33
filterInterval ?: MinMax | null ;
34
34
filterRegexp ?: string ;
35
35
order ?: string ;
36
+ includeInResult : boolean ;
36
37
}
37
38
38
39
interface ColumnMetric {
39
40
metric : string ;
40
41
filterInterval ?: MinMax | null ;
41
42
order ?: string ;
43
+ includeInResult : boolean ;
42
44
}
43
45
44
46
const MAX_DOMAIN_DISCRETE_LIST_LEN = 10 ;
@@ -56,6 +58,12 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
56
58
< hparams-split-layout orientation ="vertical ">
57
59
< div slot ="content " class ="section hyperparameters ">
58
60
< div class ="section-title "> Hyperparameters</ div >
61
+ < template is ="dom-if " if ="[[_TooManyHparams]] ">
62
+ < div class ="too-many-hparams ">
63
+ Warning: There were too many hparams to load all of them
64
+ efficiently. Only [[_maxNumHparamsToLoad]] were loaded.
65
+ </ div >
66
+ </ template >
59
67
< template is ="dom-repeat " items ="{{_hparams}} " as ="hparam ">
60
68
< div class ="hparam ">
61
69
< paper-checkbox
@@ -271,6 +279,12 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
271
279
text-decoration : underline;
272
280
margin-bottom : 7px ;
273
281
}
282
+ .too-many-hparams {
283
+ color : var (--tb-orange-dark );
284
+ font-size : 13px ;
285
+ font-style : italic;
286
+ margin : 12px 0 ;
287
+ }
274
288
.discrete-value-checkbox ,
275
289
.metric-checkbox ,
276
290
.hparam-checkbox {
@@ -432,6 +446,12 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
432
446
// 'regexp' string field containing the filtering regexp.
433
447
@property ( { type : Array } )
434
448
_hparams : any [ ] ;
449
+ // The limit to the number of hparams we will load. Loading too many will slow
450
+ // down the UI noticeably and possibly crash it.
451
+ @property ( { type : Number } ) _maxNumHparamsToLoad : number = 1000 ;
452
+ // Tracks whether we loaded the maximum number of allowed hparams as defined
453
+ // by _maxNumHparamsToLoad.
454
+ @property ( { type : Boolean } ) _tooManyHparams : boolean = false ;
435
455
// An array of objects--each storing information about the user
436
456
// setting for a single metric. Each object has the following fields:
437
457
// info: The MetricInfo object returned by the backend in the
@@ -545,6 +565,7 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
545
565
}
546
566
const experimentRequest = {
547
567
experimentName : this . experimentName ,
568
+ hparamsLimit : this . _maxNumHparamsToLoad ,
548
569
} ;
549
570
this . backend
550
571
. getExperiment ( experimentRequest )
@@ -636,6 +657,7 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
636
657
result [ i ] . displayed = true ;
637
658
}
638
659
this . set ( '_hparams' , result ) ;
660
+ this . set ( '_TooManyHparams' , result . length >= this . _maxNumHparamsToLoad ) ;
639
661
}
640
662
// Updates the _metrics property from the _experiment property.
641
663
_computeMetrics ( ) {
@@ -851,7 +873,10 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
851
873
let colParams : ( ColumnHparam | ColumnMetric ) [ ] = [ ] ;
852
874
// Build the hparams filters in the request.
853
875
this . _hparams . forEach ( ( hparam , index ) => {
854
- let colParam : ColumnHparam = { hparam : hparam . info . name } ;
876
+ let colParam : ColumnHparam = {
877
+ hparam : hparam . info . name ,
878
+ includeInResult : true ,
879
+ } ;
855
880
if ( hparam . filter . domainDiscrete ) {
856
881
const allChecked = hparam . filter . domainDiscrete . every (
857
882
( filterVal ) => filterVal . checked
@@ -880,6 +905,7 @@ class TfHparamsQueryPane extends LegacyElementMixin(PolymerElement) {
880
905
this . _metrics . forEach ( ( metric , index ) => {
881
906
let colParam : ColumnMetric = {
882
907
metric : metric . info . name ,
908
+ includeInResult : true ,
883
909
} ;
884
910
if ( isIntervalSet ( metric . filter . interval ) ) {
885
911
colParam . filterInterval = parseInputInterval (
0 commit comments