Skip to content

Commit

Permalink
Release 1.5.5 (#173)
Browse files Browse the repository at this point in the history
* chore: autopublish 2022-07-26T13:54:44Z

* Remove create-badges job

* Delete test.py

* Add multi-head masked attention

* Update multi-head gated attention to match parent layer

* Update documentation

* Test multi-head masked attention

* allow gated attention layers to use bias

* test bias in gated attention layers

* set return_attention_weights to False to avoid multi-outputs

Use MultiHeadSelfAttention and MultiHeadGatedSelfAttention if want to return the attention weights

* reformat gnns/layers.py

This commit adds new message-passing graph layers (MPN) and graph convolutional layers to dt, including vanilla MPN, GRUMPN, Masked-attention FGNN, and GraphTransformer.

* Update layers.py

* Update test_layers.py

* Update models.py

* Update test_models.py

* Update test_models.py

* Fix indexing problems related to tf.gather

* Allow multi-inputs in ContinuousGenerator

* Fix bad conversion to integer

* version bump

* Fix phase correction at focus and offset calculation

* Fix phase correction in propagation

* Fix mie phase out of foucs

* Fix mie phase out of foucs

* Update README.md

* Bm/version 1.4.0 (#137)

* Update layers.py

* Update convolutional.py

Transformer-based models can now be reused and expanded quickly and easily

* Update documentation

* Update Transformer-based models

* Delete classifying_MNIST_vit_tutorial.ipynb

* Create classifying_MNIST_vit_tutorial.ipynb

* Update datasets.py

* Allows kwargs as inputs in single_layer_call

* Update embeddings.py

* masked transformers

* reformat transformer models

* Create trajectory_analysis_tutorial.ipynb

* Add Variational autoencoders

* Add variational autoencoders

* Update vae.py

* Create MNIST_VAE_tutorial.ipynb

* Update MNIST_VAE_tutorial.ipynb

* Create folder for course examples

* Update README.md

* Update README.md

* Update examples

* Update README.md

* Update README.md

* Update MNIST VAE examples

* Added MLP regression example

* Update README.md

* Create image_segmentation_Unet.ipynb

* Update README.md

* Documented and tested cell_counting_tutorial.ipynb

* improve dnn example

* Shift variant mie

* Position mie scatterer correctly

* implement set z

* implement mnist v1

* implement z dependence

* remove logging

* Implement flattening methods

* Implement pooling and resizing

* Implement TensorflowDataset

* Finalize MNIST

* Implement Malaria classification

* alpha0 release

* fix batchsize in fit

* implement dataset.take

* Implement datasets

* fix phase in mie

* Fix mie positioning and focusing

* Commit to new branch

* add tensorflow datasets dependence

* remove test

Co-authored-by: Jesús Pineda <[email protected]>
Co-authored-by: Jesús Pineda <[email protected]>
Co-authored-by: Benjamin Midtvedt <[email protected]>
Co-authored-by: Ccx55 <[email protected]>

* Add tensorflow datasets to the list of dependencies.

* Read requirements.txt into setup.py

* remove sphinx from build

* remove create badges

* Create CITATION.cff

* Create .zenodo.json

* Update transformer models

* Update pint_definition.py

* Update requirements.txt

* create TimeDistributed CNN

* small fixes to lodestar

* Update layers.py

* Update test_layers.py

* remove direct getter of properties

* Update scatterers.py

Coherence length fix for MieScatterer

* Update scatterers.py

Added coherence length to the conversion table

* mie phase fix

* removed pydeepimagej from deps

* Change loss input order of CGAN and PCGAN

* Create dmdataset (dataset for graph-level regression tasks)

* Update gnns/__init__.py

* Add detection_linking_hela dataset

* Update dmdataset.py

* Create the regression_diffusion_landscape

* Update scatterers.py

CuPy fix for coherence length

* Update test_scatterers.py

Added a new method for testing MieSphere when coherence length parameter is provided.

* Update augmentations.py

* Update test_scatterers.py

* Update test_scatterers.py

* Create endothelial_vs dataset

* Update layers.py

* Update utils.py

* Update docs link

* Update README.md

* version bump

* version bump

* Update README.md

* Update README.md

* Update graphs.py

* Update test_generators.py

* Update generators.py

* fix test

* Update vae.py

---------

Co-authored-by: BenjaminMidtvedt <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jesús Pineda <[email protected]>
Co-authored-by: Benjamin Midtvedt <[email protected]>
Co-authored-by: Jesús Pineda <[email protected]>
Co-authored-by: Ccx55 <[email protected]>
Co-authored-by: Harshith Bachimanchi <[email protected]>
Co-authored-by: gideon <[email protected]>
Co-authored-by: Benjamin Midtvedt <[email protected]>
  • Loading branch information
10 people authored Mar 7, 2023
1 parent cd5f06b commit 8e4f348
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ We also have examples that are specific for certain models. This includes
- [*MAGIK*](deeptrack/models/gnns/) for graph-based particle linking and trace characterization.

## Documentation
The detailed documentation of DeepTrack 2.1 is available at the following link: https://softmatterlab.github.io/DeepTrack-2.0/deeptrack.html
The detailed documentation of DeepTrack 2.1 is available at the following link: https://softmatterlab.github.io/DeepTrack2/deeptrack.html

## Video Tutorials

Expand Down
6 changes: 4 additions & 2 deletions deeptrack/models/gnns/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def GetEdge(
end: int,
radius: int,
parenthood: pd.DataFrame,
columns = [],
**kwargs,
):
"""
Expand Down Expand Up @@ -79,7 +80,7 @@ def GetEdge(
edges.append(combdf)
# Concatenate the dataframes in a single
# dataframe for the whole set of edges
edgedf = pd.concat(edges)
edgedf = pd.concat(edges) if len(edges) > 0 else pd.DataFrame(columns=columns)

# Merge columns contaning the labels into a single column
# of numpy arrays, i.e., label = [label_x, label_y]
Expand Down Expand Up @@ -120,6 +121,7 @@ def EdgeExtractor(nodesdf, nofframes=3, **kwargs):
"""
# Create a copy of the dataframe to avoid overwriting
df = nodesdf.copy()
columns = df.columns

edgedfs = []
sets = np.unique(df["set"])
Expand All @@ -140,7 +142,7 @@ def EdgeExtractor(nodesdf, nofframes=3, **kwargs):
window = [elem for elem in window if elem <= df_set["frame"].max()]

# Compute the edges for each frames window
edgedf = GetEdge(df_set, start=window[0], end=window[-1], **kwargs)
edgedf = GetEdge(df_set, start=window[0], end=window[-1], columns=columns, **kwargs)
edgedf["set"] = setid
edgedfs.append(edgedf)

Expand Down
2 changes: 1 addition & 1 deletion deeptrack/models/vaes/vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def train_step(self, data):

# Sample a random point in the latent space
epsilon = tf.random.normal(shape=tf.shape(z_mean))
z = z_mean + tf.exp(z_log_var) * epsilon
z = z_mean + tf.exp(0.5 * z_log_var) * epsilon

# Reconstruct the input image
rdata = self.decoder(z)
Expand Down
33 changes: 32 additions & 1 deletion deeptrack/test/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
from .. import generators
from ..optics import Fluorescence
from ..scatterers import PointParticle
from ..models import gnns
import numpy as np

import pandas as pd

class TestGenerators(unittest.TestCase):
def test_Generator(self):
Expand Down Expand Up @@ -154,7 +155,37 @@ def get_particle_position(result):
# a = generator[idx]

# [self.assertLess(d[-1], 8) for d in generator.data]


def test_GraphGenerator(self):
frame = np.arange(10)
centroid = np.random.normal(0.5, 0.1, (10, 2))

df = pd.DataFrame(
{
'frame': frame,
'centroid-0': centroid[:, 0],
'centroid-1': centroid[:, 1],
'label': 0,
'set': 0,
'solution': 0.0
}
)
# remove consecutive frames
df = df[~df["frame"].isin([3, 4, 5])]

generator = gnns.generators.GraphGenerator(
nodesdf=df,
properties=["centroid"],
min_data_size=8,
max_data_size=9,
batch_size=8,
feature_function=gnns.augmentations.GetGlobalFeature,
radius=0.2,
nofframes=3,
output_type="edges"
)
self.assertIsInstance(generator, gnns.generators.ContinuousGraphGenerator)

if __name__ == "__main__":
unittest.main()

0 comments on commit 8e4f348

Please sign in to comment.