deeplabcut.pose_estimation_tensorflow.backbones.efficientnet_model
Contains definitions for EfficientNet model.
[1] Mingxing Tan, Quoc V. Le EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. ICML'19, https://arxiv.org/abs/1905.11946
Classes:
| Name | Description |
|---|---|
MBConvBlock |
A class of MBConv: Mobile Inverted Residual Bottleneck. |
MBConvBlockWithoutDepthwise |
MBConv-like block without depthwise convolution and squeeze-and-excite. |
Model |
A class implements tf.keras.Model for MNAS-like model. |
Functions:
| Name | Description |
|---|---|
conv_kernel_initializer |
Initialization for convolutional kernels. |
dense_kernel_initializer |
Initialization for dense kernels. |
round_filters |
Round number of filters based on depth multiplier. |
round_repeats |
Round number of filters based on depth multiplier. |
MBConvBlock
Bases: Layer
A class of MBConv: Mobile Inverted Residual Bottleneck. Attributes: endpoints: dict. A list of internal tensors.
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes a MBConv block. |
call |
Implementation of call(). |
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
__init__
Initializes a MBConv block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BlockArgs, arguments to create a Block. |
required | |
|
GlobalParams, a set of global parameters. |
required |
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
call
Implementation of call().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
the inputs tensor. |
required | |
|
boolean, whether the model is constructed for training. |
required | |
|
float, between 0 to 1, drop connect rate. |
None
|
Returns: A output tensor.
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
MBConvBlockWithoutDepthwise
Bases: MBConvBlock
MBConv-like block without depthwise convolution and squeeze-and-excite.
Methods:
| Name | Description |
|---|---|
call |
Implementation of call(). |
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
call
Implementation of call().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
the inputs tensor. |
required | |
|
boolean, whether the model is constructed for training. |
required | |
|
float, between 0 to 1, drop connect rate. |
None
|
Returns: A output tensor.
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
Model
Bases: Model
A class implements tf.keras.Model for MNAS-like model.
Reference: https://arxiv.org/abs/1807.11626
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes an |
call |
Implementation of call(). |
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | |
__init__
Initializes an Model instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
A list of BlockArgs to construct block modules. |
None
|
|
|
GlobalParams, a set of global parameters. |
None
|
Raises: ValueError: when blocks_args is not specified as a list.
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
call
Implementation of call().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
input tensors. |
required | |
|
boolean, whether the model is constructed for training. |
required | |
|
build the base feature network only. |
None
|
Returns: output tensors.
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
conv_kernel_initializer
Initialization for convolutional kernels.
The main difference with tf.variance_scaling_initializer is that tf.variance_scaling_initializer uses a truncated normal with an uncorrected standard deviation, whereas here we use a normal distribution. Similarly, tf.contrib.layers.variance_scaling_initializer uses a truncated normal with a corrected standard deviation. Args: shape: shape of variable dtype: dtype of variable partition_info: unused Returns: an initialization for the variable
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
dense_kernel_initializer
Initialization for dense kernels.
This initialization is equal to tf.variance_scaling_initializer(scale=1.0/3.0, mode='fan_out', distribution='uniform'). It is written out explicitly here for clarity. Args: shape: shape of variable dtype: dtype of variable partition_info: unused Returns: an initialization for the variable
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
round_filters
Round number of filters based on depth multiplier.
Source code in deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
round_repeats
Round number of filters based on depth multiplier.