Skip to main content

FusionLab



PyPI version Test Downloads

Documentation

FusionLab is an open-source frameworks built for Deep Learning research written in PyTorch and Tensorflow. The code is easy to read and modify especially for newbie. Feel free to send pull requests :D

Installation

With pip

pip install fusionlab

For Mac M1 chip users

Install on Macbook M1 chip

How to use

import fusionlab as fl

# PyTorch
encoder = fl.encoders.VGG16()
# Tensorflow
encoder = fl.encoders.TFVGG16()

Documentation

Doc

Encoders

encoder list

Losses

Loss func list

  • Dice Loss
  • Tversky Loss
  • IoU Loss
# Dice Loss (Multiclass)
import fusionlab as fl

# PyTorch
pred = torch.randn(1, 3, 4, 4) # (N, C, *)
target = torch.randint(0, 3, (1, 4, 4)) # (N, *)
loss_fn = fl.losses.DiceLoss()
loss = loss_fn(pred, target)

# Tensorflow
pred = tf.random.normal((1, 4, 4, 3), 0., 1.) # (N, *, C)
target = tf.random.uniform((1, 4, 4), 0, 3) # (N, *)
loss_fn = fl.losses.TFDiceLoss("multiclass")
loss = loss_fn(target, pred)


# Dice Loss (Binary)

# PyTorch
pred = torch.randn(1, 1, 4, 4) # (N, 1, *)
target = torch.randint(0, 3, (1, 4, 4)) # (N, *)
loss_fn = fl.losses.DiceLoss("binary")
loss = loss_fn(pred, target)

# Tensorflow
pred = tf.random.normal((1, 4, 4, 1), 0., 1.) # (N, *, 1)
target = tf.random.uniform((1, 4, 4), 0, 3) # (N, *)
loss_fn = fl.losses.TFDiceLoss("binary")
loss = loss_fn(target, pred)

Segmentation

import fusionlab as fl
# PyTorch UNet
unet = fl.segmentation.UNet(cin=3, num_cls=10)

# Tensorflow UNet
# Multiclass Segmentation
unet = tf.keras.Sequential([
   fl.segmentation.TFUNet(num_cls=10, base_dim=64),
   tf.keras.layers.Activation(tf.nn.softmax),
])

# Binary Segmentation
unet = tf.keras.Sequential([
   fl.segmentation.TFUNet(num_cls=1, base_dim=64),
   tf.keras.layers.Activation(tf.nn.sigmoid),
])

Segmentation model list

  • UNet
  • ResUNet
  • UNet2plus

N Dimensional Model

some models can be used in 1D, 2D, 3D

import fusionlab as fl

resnet1d = fl.encoders.ResNet50V1(cin=3, spatial_dims=1)
resnet2d = fl.encoders.ResNet50V1(cin=3, spatial_dims=2)
resnet3d = fl.encoders.ResNet50V1(cin=3, spatial_dims=3)

unet1d = fl.segmentation.UNet(cin=3, num_cls=10, spatial_dims=1)
unet2d = fl.segmentation.UNet(cin=3, num_cls=10, spatial_dims=2)
unet3d = fl.segmentation.UNet(cin=3, num_cls=10, spatial_dims=3)

News

Release logs

Acknowledgements

Metadata

Release files for fusionlab 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fusionlab 0.1.13
File Size Uploaded Provenance Actions
fusionlab-0.1.13.tar.gz 63.2 kB Without provenance Details for fusionlab-0.1.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fusionlab 0.1.13
File Interpreter ABI Platform Actions
fusionlab-0.1.13-py3-none-any.whl Python 3 none any Details for fusionlab-0.1.13-py3-none-any.whl

Total release size: 158.6 kB

Release files / fusionlab-0.1.13.tar.gz

Download URL fusionlab-0.1.13.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
253cec89e8451d0991429e60402e87133c2058a93e0d82021af6ebea5703ebe8
BLAKE2b-256 checksum
How to use checksums
2036f13675721c101d1f6bc598551d9ebb31b13c8d5bc8fa01daea36a19f45e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / fusionlab-0.1.13-py3-none-any.whl

Download URL fusionlab-0.1.13-py3-none-any.whl
Size 95.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c76e0e13f271d8e5da39fa76c56aabd6a30bda8da34981fde0b354d780563ad
BLAKE2b-256 checksum
How to use checksums
e7eac74dfc2b5b929ba7a6597b3eed5cc90d36e63b669e6c7ec8457ef3f1848e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Security for fusionlab 0.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.13 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page