Skip to content

Commit

Permalink
Merge pull request #262 from deephealthproject/develop
Browse files Browse the repository at this point in the history
Minor changes (docs & formulas)
  • Loading branch information
RParedesPalacios authored Feb 24, 2021
2 parents 5ab93fc + 23ea62c commit c0eeb39
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 60 deletions.
108 changes: 54 additions & 54 deletions docs/markdown/eddl_progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| ----- |---------|
| 🟢️ | Done |
| 🔴️ | Todo |
| 🔴| Not planned |
| | Not planned / Not supported |

# Layers
---
Expand All @@ -18,8 +18,8 @@
| Flatten | 🟢️️ | 🟢️️ | 🟢️️ | Flattens the input. Does not affect the batch size. (Wrapper for Reshape) |
| Input | 🟢️️ | 🟢️️ | 🟢️️ | Used to instantiate a EDDL tensor. |
| Reshape | 🟢️️ | 🟢️️ | 🟢️️ | Reshapes an output to a certain shape. |
| Squeeze | 🟢️️ | 🟢️️ | 🔴| Reshapes an output to a certain shape. |
| Unsqueeze | 🟢️️ | 🟢️️ | 🔴| Reshapes an output to a certain shape. |
| Squeeze | 🟢️️ | 🟢️️ | | Reshapes an output to a certain shape. |
| Unsqueeze | 🟢️️ | 🟢️️ | | Reshapes an output to a certain shape. |
| Permute | 🟢️️ | 🟢️️ | 🟢️️ | Permutes the dimensions of the input according to a given pattern. |
| Embedding | 🟢️️ | 🟢️️ | ️🟢️️ | Turns positive integers (indexes) into dense vectors of fixed size; (also known as mapping). e.g. `[[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]` |
| Transpose | 🟢️️ | 🟢️️ | ️🟢️️ | Permute the last two dimensions |
Expand All @@ -34,7 +34,7 @@
| HardSigmoid | 🟢️️ | 🟢️️ | 🟢️️ | Hard sigmoid activation function. |
| LeakyReLu | 🟢️️ | 🟢️️ | 🟢️️ | Leaky version of a Rectified Linear Unit. |
| Linear | 🟢️️ | 🟢️️ | 🟢️️ (Custom Op) | Linear (i.e. identity) activation function. |
| PReLU | 🔴️ | 🔴| 🔴️ | Parametric Rectified Linear Unit. |
| PReLU | ⚫️️ | | ⚫️️ | Parametric Rectified Linear Unit. |
| ReLu | 🟢️️ | 🟢️️ | 🟢️️ | Rectified Linear Unit. |
| Softmax | 🟢️️ | 🟢️️ | 🟢️️ | Softmax activation function. |
| Selu | 🟢️️ | 🟢️️ | 🟢️️ | Scaled Exponential Linear Unit (SELU). |
Expand All @@ -51,7 +51,7 @@
| ------------- |------| -----| ------|---------|
| Conv1D | 🟢️️ | 🟢️️ | 🟢️️ | 1D convolution. |
| Conv2D | 🟢️️ | 🟢️️ | 🟢️️ | 2D convolution. |
| Conv3D | 🔴 | 🔴️ | 🔴️ | 3D convolution. |
| Conv3D | 🔴 | 🔴️ | 🔴️ | 3D convolution. |
| Pointwise | 🟢️️ | 🟢️️ | 🟢️️ | 2D pointwise convolution. |
| DepthwiseConv2D | 🔴️ | 🔴️ | 🔴️ | 2D depthsise convolution. |
| TransposedConv2D | 🔴️ | 🔴️ | 🔴️ | Transposed convolution |
Expand All @@ -66,20 +66,20 @@ Deterministic transformations

| Functionality | CPU | GPU | ONNX | Comments |
| ------------- |------| -----| ------|---------|
| Crop | 🟢️️ | 🟢️️ | 🔴️ | Crops the given image at `[(top, left), (bottom, right)]` |
| CenteredCrop | 🟢️️ | 🟢️️ | 🔴| Crops the given image at the center with size (width, height) |
| ColorJitter | 🔴| 🔴️ | 🔴| Randomly change the brightness, contrast and saturation of an image. |
| CropScale | 🟢️️ | 🟢️️ | 🔴| Crop the given image at `[(top, left), (bottom, right)]` and scale it to the parent size |
| Cutout | 🟢️️ | 🟢️️ | 🔴| Selects a rectangle region in an image at `[(top, left), (bottom, right)]` and erases its pixels using a constant value. |
| Flip | 🟢️️ | 🟢️️ | 🔴| Flip the given image at `axis=n`. |
| Grayscale | 🔴| 🔴| 🔴️️ | Convert image to grayscale. |
| HorizontalFlip | 🟢️️ | 🟢️️ | 🔴| Horizontally flip the given image. |
| Pad | 🔴| 🔴| 🔴| Pad the given image on all sides with the given "pad" value. |
| Rotate | 🟢️️ | 🟢️️ | 🔴| Rotate the image by angle. |
| Scale | 🟢️️ | 🟢️️ | 🔴| Resize the input image to the given size. `[height, width]` |
| Shift | 🟢️️ | 🟢️️ | 🔴| Shift the input image `[a, b]` |
| VerticallyFlip | 🟢️️ | 🟢️️ | 🔴| Vertically flip the given image. |
| Normalize | 🔴 | 🔴| 🔴| Normalize an image with mean and standard deviation. |
| Crop | 🟢️️ | 🟢️️ | ⚫️️ | Crops the given image at `[(top, left), (bottom, right)]` |
| CenteredCrop | 🟢️️ | 🟢️️ | | Crops the given image at the center with size (width, height) |
| ColorJitter | | ⚫️️ | | Randomly change the brightness, contrast and saturation of an image. |
| CropScale | 🟢️️ | 🟢️️ | | Crop the given image at `[(top, left), (bottom, right)]` and scale it to the parent size |
| Cutout | 🟢️️ | 🟢️️ | | Selects a rectangle region in an image at `[(top, left), (bottom, right)]` and erases its pixels using a constant value. |
| Flip | 🟢️️ | 🟢️️ | | Flip the given image at `axis=n`. |
| Grayscale | | | ️️ | Convert image to grayscale. |
| HorizontalFlip | 🟢️️ | 🟢️️ | | Horizontally flip the given image. |
| Pad | | | | Pad the given image on all sides with the given "pad" value. |
| Rotate | 🟢️️ | 🟢️️ | | Rotate the image by angle. |
| Scale | 🟢️️ | 🟢️️ | | Resize the input image to the given size. `[height, width]` |
| Shift | 🟢️️ | 🟢️️ | | Shift the input image `[a, b]` |
| VerticallyFlip | 🟢️️ | 🟢️️ | | Vertically flip the given image. |
| Normalize | | | | Normalize an image with mean and standard deviation. |


### Data augmentations
Expand All @@ -88,17 +88,17 @@ Apply data transformations with random parametrization.

| Functionality | CPU | GPU | ONNX | Comments |
| ------------- |------| -----| ------|---------|
| RandomAffine | 🔴| 🔴| 🔴| Random affine transformation of the image keeping center invariant: rotate+translate+scale+shear |
| RandomCrop | 🟢️️ | 🟢️️ | 🔴| Crop the given image at a random location with size `[height, width]` |
| RandomCropScale | 🟢️️ | 🟢️️ | 🔴| Crop the given image randomly by the size in a range `[a, b]` by and scale it to the parent size |
| RandomCutout | 🟢️️ | 🟢️️ | 🔴| Randomly selects a rectangle region in an image and erases its pixels. The random region is defined by the range `[(min_x, max_x), (min_y, max_y)]`, where these are relative values |
| RandomFlip | 🟢️️ | 🟢️️ | 🔴| Flip the given image at `axis=n` randomly with a given probability. |
| RandomGrayscale | 🔴 | 🔴 | 🔴| Randomly convert image to grayscale with a probability of p (default 0.1). |
| RandomHorizontalFlip | 🟢️️ | 🟢️️ | 🔴| Horizontally flip the given image randomly with a given probability. |
| RandomRotation | 🟢️️ | 🟢️️ | 🔴| Rotate the image randomly by an angle defined in a range `[a, b]`. |
| RandomScale | 🟢️️ | 🟢️️ | 🔴| Resize the input image randomly by the size in a range `[a, b]` |
| RandomShift | 🟢️️ | 🟢️️ | 🔴| Shift the input image randomly in range `[a, b]` |
| RandomVerticalFlip | 🟢️️ | 🟢️️ | 🔴| Vertically flip the given image randomly with a given probability. |
| RandomAffine | | | | Random affine transformation of the image keeping center invariant: rotate+translate+scale+shear |
| RandomCrop | 🟢️️ | 🟢️️ | | Crop the given image at a random location with size `[height, width]` |
| RandomCropScale | 🟢️️ | 🟢️️ | | Crop the given image randomly by the size in a range `[a, b]` by and scale it to the parent size |
| RandomCutout | 🟢️️ | 🟢️️ | | Randomly selects a rectangle region in an image and erases its pixels. The random region is defined by the range `[(min_x, max_x), (min_y, max_y)]`, where these are relative values |
| RandomFlip | 🟢️️ | 🟢️️ | | Flip the given image at `axis=n` randomly with a given probability. |
| RandomGrayscale | | | | Randomly convert image to grayscale with a probability of p (default 0.1). |
| RandomHorizontalFlip | 🟢️️ | 🟢️️ | | Horizontally flip the given image randomly with a given probability. |
| RandomRotation | 🟢️️ | 🟢️️ | | Rotate the image randomly by an angle defined in a range `[a, b]`. |
| RandomScale | 🟢️️ | 🟢️️ | | Resize the input image randomly by the size in a range `[a, b]` |
| RandomShift | 🟢️️ | 🟢️️ | | Shift the input image randomly in range `[a, b]` |
| RandomVerticalFlip | 🟢️️ | 🟢️️ | | Vertically flip the given image randomly with a given probability. |


## Merge layers
Expand All @@ -120,19 +120,19 @@ Apply data transformations with random parametrization.
| Functionality | CPU | GPU | ONNX | Comments |
| ------------- |------| -----| ------|---------|
| BatchNormalization | 🟢️️ | 🟢️️ | 🟢️️ | Batch normalization layer (Ioffe and Szegedy, 2014). |
| LayerNormalization | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | Layer normalization layer (Ba et al., 2016) |
| GroupNormalization | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | Group normalization layer (Yuxin Wu and Kaiming He, 2018). |
| Norm | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | |
| NormMax | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | |
| NormMinMax | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | |
| LayerNormalization | 🟢️️ | 🟢️️ | (Not in ONNX) | Layer normalization layer (Ba et al., 2016) |
| GroupNormalization | 🟢️️ | 🟢️️ | (Not in ONNX) | Group normalization layer (Yuxin Wu and Kaiming He, 2018). |
| Norm | 🟢️️ | 🟢️️ | (Not in ONNX) | |
| NormMax | 🟢️️ | 🟢️️ | (Not in ONNX) | |
| NormMinMax | 🟢️️ | 🟢️️ | (Not in ONNX) | |


## Noise layers

| Functionality | CPU | GPU | ONNX | Comments |
| ------------- |------| -----| ------|---------|
| GaussianNoise | 🟢️️ | 🟢️️ |🔴️ (Not in ONNX) | Apply additive zero-centered Gaussian noise. |
| UniformNoise | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | Apply additive zero-centered uniform noise.
| GaussianNoise | 🟢️️ | 🟢️️ | (Not in ONNX) | Apply additive zero-centered Gaussian noise. |
| UniformNoise | 🟢️️ | 🟢️️ | (Not in ONNX) | Apply additive zero-centered uniform noise.


## Pooling layers
Expand Down Expand Up @@ -162,11 +162,11 @@ Apply data transformations with random parametrization.
| Div | 🟢️️ | 🟢️️ | 🟢️️ | |
| Exp | 🟢️️ | 🟢️️ | 🟢️️ | |
| Log | 🟢️️ | 🟢️️ | 🟢️️ | |
| Log2 | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | |
| Log10 | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | |
| Log2 | 🟢️️ | 🟢️️ | (Not in ONNX) | |
| Log10 | 🟢️️ | 🟢️️ | (Not in ONNX) | |
| Mult | 🟢️️ | 🟢️️ | 🟢️️ | |
| Pow | 🔴️ | 🔴️ | 🔴️ | |
| Select | 🟢️️ | 🟢️️ | 🔴️ (Not in ONNX) | |
| Select | 🟢️️ | 🟢️️ | (Not in ONNX) | |
| Sqrt | 🟢️️ | 🟢️️ | 🟢️️ | |
| Sub | 🟢️️ | 🟢️️ | 🟢️️ | |

Expand All @@ -179,7 +179,7 @@ Apply data transformations with random parametrization.
| Mean | 🟢️️| 🟢️️ | 🟢️️ | |
| Min | 🟢️️| 🟢️️ | 🟢️️ | |
| Sum | 🟢️️| 🟢️️ | 🟢️️ | |
| Var | 🟢️️| 🟢️️ | 🔴️ (Not in ONNX) | |
| Var | 🟢️️| 🟢️️ | (Not in ONNX) | |
| Argmax | 🟢️️| 🟢️️ | 🟢️️ | |


Expand Down Expand Up @@ -210,24 +210,24 @@ Apply data transformations with random parametrization.
| GlorotUniform | 🟢️️ | 🟢️️ | Glorot uniform initializer, also called Xavier uniform initializer. |
| HeNormal | 🟢️️ | 🟢️️ | _He_ normal initializer. |
| HeUniform | 🟢️️ | 🟢️️ | _He_ uniform initializer. |
| Identity | 🔴| 🔴| Initializer that generates the identity matrix. |
| LeCunUniform | 🔴 | 🔴 | LeCun uniform initializer. |
| LeCunNormal | 🔴 | 🔴 | LeCun normal initializer. |
| Orthogonal | 🔴| 🔴 | Initializer that generates a random orthogonal matrix. |
| Identity | | | Initializer that generates the identity matrix. |
| LeCunUniform | | | LeCun uniform initializer. |
| LeCunNormal | | | LeCun normal initializer. |
| Orthogonal | | | Initializer that generates a random orthogonal matrix. |
| RandomNormal | 🟢️️ | 🟢️️ | Initializer that generates tensors with a normal distribution. |
| RandomUniform | 🟢️️ | 🟢️️ | Initializer that generates tensors with a uniform distribution. |
| TruncatedNormal | 🔴 | 🔴 | Initializer that generates a truncated normal distribution. |
| VarianceScaling | 🔴 | 🔴| Initializer capable of adapting its scale to the shape of weights. |
| TruncatedNormal | | | Initializer that generates a truncated normal distribution. |
| VarianceScaling | | | Initializer capable of adapting its scale to the shape of weights. |


# Constraints

| Functionality | CPU | GPU | Comments |
| ------------- |------| -----|---------|
| MaxNorm | 🔴️ | 🔴️ | MaxNorm weight constraint. |
| MinMaxNorm | 🔴️ | 🔴️ | MinMaxNorm weight constraint. |
| NonNeg | 🔴️ | 🔴️ | Constrains the weights to be non-negative. |
| UnitNorm | 🔴️ | 🔴️ | Constrains the weights incident to each hidden unit to have unit norm. |
| MaxNorm | ⚫️ | ⚫️️ | MaxNorm weight constraint. |
| MinMaxNorm | ⚫️ | ⚫️️ | MinMaxNorm weight constraint. |
| NonNeg | ⚫️ | ⚫️️ | Constrains the weights to be non-negative. |
| UnitNorm | ⚫️ | ⚫️️ | Constrains the weights incident to each hidden unit to have unit norm. |


# Loss functions
Expand All @@ -241,7 +241,7 @@ Apply data transformations with random parametrization.
| MRE | 🔴️ | 🔴️ | Mean Relative Error |
| MSLE | 🔴️ | 🔴️ | Mean Squared Logarithmic Error |
| Min | 🟢️️ | 🟢️️ | Minimum Error |
| Hinge | 🔴️ | 🔴️ | Hinge Error |
| Hinge | | | Hinge Error |
| Dice | 🟢️️ | 🟢️️ | Dice loss |
| SoftCrossEntropy | 🟢️️ | 🟢️️ | Soft-Categorical Cross-Entropy Error |

Expand All @@ -251,8 +251,8 @@ Apply data transformations with random parametrization.
| Functionality | CPU | GPU | Comments |
| ------------- |------| -----|---------|
| CategoricalAccuracy | 🟢️️ | 🟢️️ | |
| TopKAccuracy | 🔴️ | 🔴 | |
| CosineProximity | 🔴️ | 🔴️ | |
| TopKAccuracy | | | |
| CosineProximity | | | |
| MSE | 🟢️️ | 🟢️️ | Mean Squared Error |
| MAE | 🟢️️ | 🟢️️ | Mean Absolute Error |
| MRE | 🟢️️ | 🟢️️ | Mean Relative Error |
Expand Down
30 changes: 30 additions & 0 deletions docs/sphinx/source/intro/troubleshoot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,33 @@ If you want to run it using the conda environment, add:
echo $CONDA_PREFIX
.. _more: https://stackoverflow.com/questions/39979836/using-openmp-with-c11-on-mac-os


Loading datasets
-----------------

Loading Numpy files (.npy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Currently, we cannot do this natively from the EDDL. However, you can do it with the PyEDDL.

First, install Numpy and the PyEDDL in you environment:

.. code:: bash
pip install numpy
conda install -c dhealth pyeddl-cpu # or *-gpu
Then, we need to create a python file (``test.py``) in order to read the numpy file and convert it to ``.bin``:

.. code:: python
from pyeddl.tensor import Tensor
import numpy as np
# Convert numpy to bin
t_npy = np.load("myarray.npy")
t_eddl = Tensor.fromarray(t_npy)
t_eddl.save("myarray.bin")
8 changes: 4 additions & 4 deletions formulas/brew/eddl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
class Eddl < Formula
desc "European Distributed Deep Learning Library (EDDL)"
homepage "https://github.com/deephealthproject/eddl"
url "https://github.com/deephealthproject/eddl/archive/v0.9a.tar.gz"
sha256 "93372aca9133f847c9dd2dd678a2107e9424d512e806929065fbe2a17270a425"
url "https://github.com/deephealthproject/eddl/archive/v0.9.1b.tar.gz"
sha256 "a486d699036feb893bfd95e60405ddf8d3cd9f3e4eabb61f3e65b1b7e01a1139"

depends_on "cmake" => :build
depends_on "eigen" => :build
Expand All @@ -17,8 +17,8 @@ class Eddl < Formula

def install
mkdir "build" do
system "cmake", "..", "-DBUILD_SUPERBUILD=OFF", "-DBUILD_EXAMPLES=OFF", "-DBUILD_TESTS=OFF", *std_cmake_args
system "make", "install", "PREFIX=#{prefix}"
system "cmake", "..", "-DBUILD_SUPERBUILD=OFF", "-DBUILD_EXAMPLES=OFF", "-DBUILD_TESTS=OFF", "-DBUILD_OPENMP=OFF" *std_cmake_args
system "make", "-j", "install", "PREFIX=#{prefix}"
end
end

Expand Down
4 changes: 2 additions & 2 deletions formulas/conda/eddl/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "eddl-cpu" %} # If this is a package for GPU, use: "eddl-gpu"
{% set version = "0.9a" %}
{% set sha256 = "93372aca9133f847c9dd2dd678a2107e9424d512e806929065fbe2a17270a425" %}
{% set version = "0.9.1b" %}
{% set sha256 = "a486d699036feb893bfd95e60405ddf8d3cd9f3e4eabb61f3e65b1b7e01a1139" %}

package:
name: {{ name|lower }}
Expand Down

0 comments on commit c0eeb39

Please sign in to comment.