MCPcopy Create free account
hub / github.com/cure-lab/deep-active-learning / float_parameter

Function float_parameter

query_strategies/augmentations.py:41–52  ·  view source on GitHub ↗

Helper function to scale `val` between 0 and maxval. Args: level: Level of the operation that will be between [0, `PARAMETER_MAX`]. maxval: Maximum value that the operation can have. This will be scaled to level/PARAMETER_MAX. Returns: A float that results from scaling `maxva

(level, maxval)

Source from the content-addressed store, hash-verified

39
40
41def float_parameter(level, maxval):
42 """Helper function to scale `val` between 0 and maxval.
43
44 Args:
45 level: Level of the operation that will be between [0, `PARAMETER_MAX`].
46 maxval: Maximum value that the operation can have. This will be scaled to
47 level/PARAMETER_MAX.
48
49 Returns:
50 A float that results from scaling `maxval` according to `level`.
51 """
52 return float(level) * maxval / 10.
53
54
55def sample_level(n):

Callers 6

shear_xFunction · 0.85
shear_yFunction · 0.85
colorFunction · 0.85
contrastFunction · 0.85
brightnessFunction · 0.85
sharpnessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected