(
self,
model,
input_record,
name='dropout',
ratio=0.5,
dropout_for_eval=False,
**kwargs)
| 11 | class Dropout(ModelLayer): |
| 12 | |
| 13 | def __init__( |
| 14 | self, |
| 15 | model, |
| 16 | input_record, |
| 17 | name='dropout', |
| 18 | ratio=0.5, |
| 19 | dropout_for_eval=False, |
| 20 | **kwargs): |
| 21 | |
| 22 | super().__init__(model, name, input_record, **kwargs) |
| 23 | assert isinstance(input_record, schema.Scalar), "Incorrect input type" |
| 24 | assert (ratio >= 0 and ratio < 1.0), \ |
| 25 | "Expected 0 <= ratio < 1, but got ratio of %s" % ratio |
| 26 | |
| 27 | self.output_schema = input_record.clone_schema() |
| 28 | self.output_schema.set_value(self.get_next_blob_reference('output')) |
| 29 | self.dropout_for_eval = dropout_for_eval |
| 30 | |
| 31 | self.ratio = ratio |
| 32 | |
| 33 | def _add_ops(self, net, is_test): |
| 34 | input_blob = self.input_record.field_blobs() |
nothing calls this directly
no test coverage detected