Hi Akt!



 AKT_TARAFDER:

def create_ensembles(num):
    ensembles=[model for i in range(num)]
    
    return ensembles

ensembles=create ensembles(10)

Does this create 10 isolated neural networks that can be trained by looping?


Your code creates only a single neural network.
This is really a python question rather than about pytorch in particular.
Your create_ensembles() creates a list (using a list comprehension)
that contains num references that all refer to the same model.
You first instantiate a single instance of a Sequential (and then
assign it to the reference model).  create_ensembles() then makes
10 copies of that same reference and puts them in a list.
Here is some pure python (no pytorch) that illustrates what is going on:
>>> dict = {}     # make an instance of something
>>> l = [dict for i in range (5)]
>>> for i in l:   # all elements of the list refer to the same instance
...     print (id (l))
...
139963655730048
139963655730048
139963655730048
139963655730048
139963655730048

What you would want to do instead is package your desired network
architecture as python class, and then instantiate num instances of
your network class.
This tutorial, PyTorch: Custom nn Modules 3, gives an example of defining
such a class.
Good luck.
K. Frank