the 2nd Anomalous Diffusion (AnDi) Challenge Forum

Go back to competition Back to thread list Post in this thread

> Confinement Code

Briefly interested in the confinement code and the way it lays down compartment centers. The code in models_phenom is

for n in range(N):

# Defined physical parameters for each trajectory
alphas_traj, Ds_traj = self._sample_diff_parameters(alphas = alphas,
Ds = Ds,
num_states = 2,
epsilon_a = epsilon_a,
gamma_d = gamma_d)

# Get trajectory from single traj function
pos, lab = self._confinement_traj(T = T,
Ds = Ds_traj,
alphas = alphas_traj,
L = L,
deltaT = deltaT,
r = r,
comp_center = comp_center, <-----------
Nc = Nc,
trans = trans)
data[:, n, :] = pos
labels[:, n, :] = lab

As I understand, comp_center is None when using challenge_phenom_dataset. So this code loops over all particles and generates a new set of comp_centers for each particle as this gets called multiple times:
if comp_center is None:
comp_center = models_phenom._distribute_circular_compartments(Nc = Nc,
r = r,
L = L)

Is this meant to be like this such that every particle sees a different set of centers? Is it not more efficient to create the compartment centers outside of the loop and all the particles "see" the same compartment centers?
(Sorry if I misunderstood the code.)

Posted by: selfschuk @ May 22, 2024, 12:21 p.m.

Hi!

You are completely right about how the code works. Note that that function is written to work as generally as possible. Whenever models_phenom.confinement receives comp_centers = None, it will work as you say. However, you can input a given comp_centers array (which fixes the number of compartments and their position) that will be then passed to each of the particle simulations (see for instance the example given in the source code, just below the function definition: https://andichallenge.github.io/andi_datasets/lib_nbs/models_phenom.html#dataset-generation-2).

In the challenge we will have both cases, with fixed and changing compartments centers.

From a biological perspective, the latter can be thought as: 1) having temporal heterogeneity, in which the compartment distribution changes over time, hence each particle moving in an effectively different environment; 2) the case in which different particles perceive different disorders due to their biological functions.

Best,

Gorka

Posted by: gorka.munoz @ May 22, 2024, 1:10 p.m.
Post in this thread