Shared Layers API¶
Auto-generated from source — building blocks shared across model families.
keras_climate.utils.layers¶
keras_climate.utils.layers.DropPath ¶
DropPath(drop_prob=0.0, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
9 10 11 | |
keras_climate.utils.layers.MLP ¶
MLP(hidden_dim, out_dim=None, act='gelu', drop=0.0, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
30 31 32 33 34 35 | |
keras_climate.utils.layers.GatedResidualNetwork ¶
GatedResidualNetwork(units, dropout=0.1, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
57 58 59 60 | |
keras_climate.utils.layers.MultiHeadSelfAttention ¶
MultiHeadSelfAttention(dim, num_heads=8, qkv_bias=True, attn_drop=0.0, proj_drop=0.0, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
88 89 90 91 92 93 94 95 96 97 98 | |
keras_climate.utils.layers.SpatialReductionAttention ¶
SpatialReductionAttention(dim, num_heads=8, sr_ratio=1, qkv_bias=True, attn_drop=0.0, proj_drop=0.0, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
keras_climate.utils.layers.TransformerEncoderBlock ¶
TransformerEncoderBlock(dim, num_heads, mlp_ratio=4.0, qkv_bias=True, drop=0.0, attn_drop=0.0, drop_path=0.0, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
keras_climate.utils.layers.SegformerBlock ¶
SegformerBlock(dim, num_heads, mlp_ratio=4.0, sr_ratio=1, drop=0.0, attn_drop=0.0, drop_path=0.0, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
keras_climate.utils.layers.PatchEmbed2D ¶
PatchEmbed2D(patch_size, embed_dim, in_chans=None, norm=True, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
274 275 276 277 278 | |
keras_climate.utils.layers.OverlapPatchEmbed ¶
OverlapPatchEmbed(patch_size, stride, embed_dim, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
305 306 307 308 309 | |
keras_climate.utils.layers.PatchEmbed3D ¶
PatchEmbed3D(patch_size, tubelet_size, embed_dim, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
336 337 338 339 340 | |
keras_climate.utils.layers.DoubleConv ¶
DoubleConv(filters, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
484 485 486 487 | |
keras_climate.utils.layers.ASPP ¶
ASPP(filters=256, rates=(6, 12, 18), **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
497 498 499 500 | |
keras_climate.utils.layers.ConvBNAct ¶
ConvBNAct(filters, kernel_size=3, strides=1, dilation_rate=1, act='relu', use_bn=True, **kwargs)
Bases: Layer
Source code in keras_climate/utils/layers.py
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 | |
keras_climate.utils.layers.rfft2_hw ¶
rfft2_hw(x)
Source code in keras_climate/utils/layers.py
363 364 365 366 367 368 369 370 371 372 373 | |
keras_climate.utils.layers.irfft2_hw ¶
irfft2_hw(re, im, H, W)
Source code in keras_climate/utils/layers.py
376 377 378 379 380 381 382 383 384 385 | |
keras_climate.utils.layers.unpatchify_2d ¶
unpatchify_2d(x, grid_h, grid_w, patch_size, out_channels, name='unpatchify')
Source code in keras_climate/utils/layers.py
388 389 390 391 392 393 394 395 396 397 398 399 | |
keras_climate.utils.layers.sincos_position_embedding ¶
sincos_position_embedding(length, dim)
Source code in keras_climate/utils/layers.py
402 403 404 405 406 407 408 | |
keras_climate.utils.layers.sincos_position_embedding_2d ¶
sincos_position_embedding_2d(h, w, dim)
Source code in keras_climate/utils/layers.py
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | |