Creating a layer that duplicates a sub-model a variable amount of times

When creating a Siamese Network you create a model and instantiate it twice. I wish to create a layer that will instantiate the model a variable number of times based on the input. It will then take the outputs of all of those models and do the distance math returning a fixed number of outputs.

Important notes: The model is not pretrained, the goal is training that model. While not required, I would prefer the replies in relation to keras.

Hi @Gamedungeon

Welcome to the TensorFlow Forum!

Could you please share minimal reproducible code to replicate and understand the issue to better help you in this. Thank you.

Hello, thanks for responding, but I asked this two years ago now and really can’t remember much about that project or provide code from it.