Background
fit_background(spot_colors, weight_shift=0)
This determines the coefficient of the background vectors for each spot. Coefficients determined using a weighted dot product as to avoid overfitting and accounting for the fact that background coefficients are not updated after this.
Note
background_vectors[i]
is 1 in channel i
for all rounds and 0 otherwise.
It is then normalised to have L2 norm of 1 when summed over all rounds and channels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spot_colors |
np.ndarray
|
|
required |
weight_shift |
float
|
shift to apply to weighting of each background vector to limit boost of weak spots. |
0
|
Returns:
Type | Description |
---|---|
np.ndarray
|
|
np.ndarray
|
|
np.ndarray
|
|
Source code in coppafish/call_spots/background.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
Optimised
fit_background(spot_colors, weight_shift)
This determines the coefficient of the background vectors for each spot. Coefficients determined using a weighted dot product as to avoid overfitting and accounting for the fact that background coefficients are not updated after this.
Note
background_vectors[i]
is 1 in channel i
for all rounds and 0 otherwise.
It is then normalised to have L2 norm of 1 when summed over all rounds and channels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spot_colors |
jnp.ndarray
|
|
required |
weight_shift |
float
|
shift to apply to weighting of each background vector to limit boost of weak spots. |
required |
Returns:
Type | Description |
---|---|
jnp.ndarray
|
|
jnp.ndarray
|
|
jnp.ndarray
|
|
Source code in coppafish/call_spots/background_optimised.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
fit_background_single(spot_color, weight_shift)
This determines the coefficient of the background vectors. Coefficients determined using a weighted dot product as to avoid over-fitting and accounting for the fact that background coefficients are not updated after this.
Note
background_vectors[i]
is 1 in channel i
for all rounds and 0 otherwise.
It is then normalised to have L2 norm of 1 when summed over all rounds and channels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spot_color |
jnp.ndarray
|
|
required |
weight_shift |
float
|
shift to apply to weighting of each background vector to limit boost of weak spots. |
required |
Returns:
Type | Description |
---|---|
jnp.ndarray
|
|
jnp.ndarray
|
|
jnp.ndarray
|
|
Source code in coppafish/call_spots/background_optimised.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|