mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-26 07:39:22 +02:00
training.models.transformer_block: tf.reshape → Keras Reshape layer
This commit is contained in:
parent
9efce5e9f2
commit
86adaf299a
2 changed files with 8 additions and 8 deletions
|
|
@ -309,11 +309,10 @@ def transformer_block(img,
|
|||
# Skip connection 2.
|
||||
encoded_patches = Add()([x3, x2])
|
||||
|
||||
encoded_patches = tf.reshape(encoded_patches,
|
||||
[-1,
|
||||
img.shape[1],
|
||||
img.shape[2],
|
||||
projection_dim // (patchsize_x * patchsize_y)])
|
||||
encoded_patches = Reshape(target_shape=(img.shape[1],
|
||||
img.shape[2],
|
||||
projection_dim // (patchsize_x * patchsize_y)),
|
||||
name="reshape_patches")(encoded_patches)
|
||||
return encoded_patches
|
||||
|
||||
def vit_resnet50_unet(num_patches,
|
||||
|
|
|
|||
|
|
@ -26,16 +26,17 @@ RELOADABLE_MODELS = \
|
|||
all: $(RELOADABLE_MODELS)
|
||||
|
||||
$(MODELS_DST)/%: $(MODELS_SRC)/%
|
||||
mkdir -p $@
|
||||
test -e $</config.json || exit 1
|
||||
eynollah-training train --force \
|
||||
{ mkdir -p $@ \
|
||||
&& eynollah-training train --force \
|
||||
with $</config.json \
|
||||
reload_weights=True \
|
||||
continue_training=False \
|
||||
dir_output=$(dir $@) \
|
||||
dir_of_start_model=$< \
|
||||
&& cp $</config.json $@/config.json \
|
||||
|| { rm -rf $@; false; }; } \
|
||||
2>&1 | tee $(notdir $<).log
|
||||
cp $</config.json $@/config.json
|
||||
|
||||
compare:
|
||||
for i in `find $(MODELS_DST) -mindepth 2`;do \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue