MCPcopy Create free account
hub / github.com/CandleLabAI/PCBSegClassNet / get_decoder

Function get_decoder

src/models/blocks.py:348–391  ·  view source on GitHub ↗
(encoder, learning_layer1, learning_layer2, num_classes)

Source from the content-addressed store, hash-verified

346 return model, learning_layer1, learning_layer2
347
348def get_decoder(encoder, learning_layer1, learning_layer2, num_classes):
349
350 inputs = encoder.input
351 out = encoder.output
352 out = tem_block(out)
353
354 classifier1 = conv_block(out,
355 conv_type="ds",
356 filters=128,
357 kernel_size=(3, 3),
358 strides=(1, 1),
359 padding="same",
360 relu=True,
361 upsampling=True,
362 up_sample_size=2,
363 skip_layer=learning_layer2)
364
365 classifier2 = conv_block(classifier1,
366 conv_type="ds",
367 filters=128,
368 kernel_size=(3, 3),
369 strides=(1, 1),
370 padding="same",
371 relu=True,
372 upsampling=True,
373 up_sample_size=2,
374 skip_layer=learning_layer1)
375
376
377 classifier2 = tf.keras.layers.UpSampling2D(size=(2, 2),
378 data_format="channels_last")(classifier2)
379
380 classifier3 = tf.keras.layers.Conv2D(filters=num_classes,
381 kernel_size=(1,1),
382 padding="same",
383 strides=(1, 1))(classifier2)
384 classifier3 = tf.keras.layers.BatchNormalization(axis=3)(classifier3)
385 classifier3 = tf.keras.activations.softmax(classifier3)
386
387 # get final model
388 model = tf.keras.models.Model(inputs=[inputs],
389 outputs=[classifier3],
390 name="pcb-decoder")
391 return model
392
393def get_classification(encoder, num_classes):
394 inputs = encoder.inputs

Callers 1

buildMethod · 0.85

Calls 2

tem_blockFunction · 0.85
conv_blockFunction · 0.85

Tested by

no test coverage detected