(self, value)
| 26 | raise NotImplementedError |
| 27 | |
| 28 | def C(self, value): |
| 29 | if isinstance(value, int) or isinstance(value, float): |
| 30 | pass |
| 31 | else: |
| 32 | value = config_to_primitive(value) |
| 33 | if not isinstance(value, list): |
| 34 | raise TypeError('Scalar specification only supports list, got', type(value)) |
| 35 | if len(value) == 3: |
| 36 | value = [0] + value |
| 37 | assert len(value) == 4 |
| 38 | start_step, start_value, end_value, end_step = value |
| 39 | if isinstance(end_step, int): |
| 40 | current_step = self.global_step |
| 41 | value = start_value + (end_value - start_value) * max(min(1.0, (current_step - start_step) / (end_step - start_step)), 0.0) |
| 42 | elif isinstance(end_step, float): |
| 43 | current_step = self.current_epoch |
| 44 | value = start_value + (end_value - start_value) * max(min(1.0, (current_step - start_step) / (end_step - start_step)), 0.0) |
| 45 | return value |
| 46 | |
| 47 | def preprocess_data(self, batch, stage): |
| 48 | pass |
no test coverage detected