Open gtdang opened 4 months ago
Is it an easy addition? The probability should default to 1.0
for all connections.
If it's straight forward to implement then I would say yes, it's a line of investigation that people haven't gone down because it wasn't possible in the old GUI
Do all connections and all weights have an associated probability? Or is it conditional?
Whenever you call net.add_connection
to add a drive or connect cell types, there's a probability
argument that let's you randomly select some subset of all possible cell-cell connections. In that sense any entry in the net.connectivity
list could have probability < 1.0
, but by default it's always set to 1.0
.
Where we need to be careful is that net.connectivity[conn_idx]['gid_pairs']
will change depending on the value of probability
and conn_seed
. Since the GUI builds each connection separately from the widget I don't think this will be a problem, since net.add_connection
is still being used when you hit the run button and compile the Network
object
Working on the Network configuration export I noticed that the GUI is not using the connection probability in any way.
The connectivity only have a weight widget parameter.
The connectivity widget constructor is shown below. Notice the docstring mentions probability, but it is not in the box construct. It's a bit hard to read but the connectivity box is a vertical box (Vbox) composed of 3 elements:
The Problem A problem arises when initializing the new network from widget values. It tries to assign a probability from a widget that does not exist (see below). The
vbox_key.children[2].value
, is not a probability widget but the html widget that styles the black horizontal bar. So the network actually gets assigned a probability value of"<hr style='margin-bottom:5px'/>"
! https://github.com/jonescompneurolab/hnn-core/blob/a1c94ee2f83e3b7a432fb03daa659f25a05da98a/hnn_core/gui/gui.py#L1650-L1653Solution I suppose the easiest solution is to just add the probability as a widget for all the connections. Does this make sense for all types of connections?