(
self, model, label, smooth_matrix, name='label_smooth', **kwargs
)
| 27 | |
| 28 | class LabelSmooth(ModelLayer): |
| 29 | def __init__( |
| 30 | self, model, label, smooth_matrix, name='label_smooth', **kwargs |
| 31 | ): |
| 32 | super().__init__(model, name, label, **kwargs) |
| 33 | self.label = label |
| 34 | # shape as a list |
| 35 | smooth_matrix = np.array(smooth_matrix).astype(np.float32).flatten() |
| 36 | self.set_dim(smooth_matrix) |
| 37 | self.set_smooth_matrix(smooth_matrix) |
| 38 | self.output_schema = schema.Scalar( |
| 39 | (np.float32, (self.dim, )), |
| 40 | self.get_next_blob_reference('smoothed_label') |
| 41 | ) |
| 42 | |
| 43 | def set_dim(self, smooth_matrix): |
| 44 | num_elements = smooth_matrix.size |
nothing calls this directly
no test coverage detected