1010import functools
1111import itertools
1212import math
13- from typing import Any , Callable , Dict , List , Sequence , Text , Tuple , Union
13+ from typing import Any , Callable , Dict , List , Sequence , Tuple , Union
1414
1515from absl import logging
1616from numpy import random
1717
18- _SweepSequence = List [Dict [Text , Any ]]
19- _GeneratorFn = Callable [[float ], Tuple [Text , float ]]
18+ _SweepSequence = List [Dict [str , Any ]]
19+ _GeneratorFn = Callable [[float ], Tuple [str , float ]]
2020
2121
2222def generate_primes (n : int ) -> List [int ]:
@@ -195,10 +195,10 @@ def generate_sequence(num_samples: int,
195195 return halton_sequence
196196
197197
198- def _generate_double_point (name : Text ,
198+ def _generate_double_point (name : str ,
199199 min_val : float ,
200200 max_val : float ,
201- scaling : Text ,
201+ scaling : str ,
202202 halton_point : float ) -> Tuple [str , float ]:
203203 """Generate a float hyperparameter value from a Halton sequence point."""
204204 if scaling not in ['linear' , 'log' ]:
@@ -234,7 +234,7 @@ def interval(start: int, end: int) -> Tuple[int, int]:
234234 return start , end
235235
236236
237- def loguniform (name : Text , range_endpoints : Tuple [int , int ]) -> _GeneratorFn :
237+ def loguniform (name : str , range_endpoints : Tuple [int , int ]) -> _GeneratorFn :
238238 min_val , max_val = range_endpoints
239239 return functools .partial (_generate_double_point ,
240240 name ,
@@ -244,7 +244,7 @@ def loguniform(name: Text, range_endpoints: Tuple[int, int]) -> _GeneratorFn:
244244
245245
246246def uniform (
247- name : Text , search_points : Union [_DiscretePoints ,
247+ name : str , search_points : Union [_DiscretePoints ,
248248 Tuple [int , int ]]) -> _GeneratorFn :
249249 if isinstance (search_points , _DiscretePoints ):
250250 return functools .partial (_generate_discrete_point ,
0 commit comments