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)
| 39 | |
| 40 | |
| 41 | def 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 | |
| 55 | def sample_level(n): |