use convolution layer to extract feature . Args: inputs (tensor): Input tensor. Returns: Output of the final convolution layer in the efficientnet model.
(self, inputs)
| 454 | return endpoints |
| 455 | |
| 456 | def extract_features(self, inputs): |
| 457 | """use convolution layer to extract feature . |
| 458 | Args: |
| 459 | inputs (tensor): Input tensor. |
| 460 | Returns: |
| 461 | Output of the final convolution |
| 462 | layer in the efficientnet model. |
| 463 | """ |
| 464 | # Stem |
| 465 | x = self._swish(self._bn0(self._conv_stem(inputs))) |
| 466 | |
| 467 | # Blocks |
| 468 | for idx, block in enumerate(self._blocks): |
| 469 | drop_connect_rate = self._global_params.drop_connect_rate |
| 470 | if drop_connect_rate: |
| 471 | drop_connect_rate *= float(idx) / len(self._blocks) # scale drop connect_rate |
| 472 | x = block(x, drop_connect_rate=drop_connect_rate) |
| 473 | |
| 474 | # Head |
| 475 | x = self._swish(self._bn1(self._conv_head(x))) |
| 476 | |
| 477 | return x |
| 478 | |
| 479 | def forward(self, inputs): |
| 480 | """EfficientNet's forward function. |
nothing calls this directly
no outgoing calls
no test coverage detected