Skip to content

Commit

Permalink
Merge pull request #198 from deephealthproject/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
RParedesPalacios authored Oct 6, 2020
2 parents 1f3914f + 29bdbad commit 06043a9
Show file tree
Hide file tree
Showing 32 changed files with 1,636 additions and 403 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ if(UNIX)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

# Flags: Debugging
# Flags: Sanitizers
# For the visualized output to be available, switch to Clang at least 3.8.0 or GCC at least 5.0.0
if(BUILD_SANITIZERS)
set(CMAKE_CXX_FLAGS_DEBUG "-O1 -g")

# Add sanitizers
#For more info: https://www.jetbrains.com/help/clion/google-sanitizers.html
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer") # address, leak, thread, undefined, memory
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-recover=address") # address, leak, thread, undefined, memory
endif()

# Code coverage
# Read: https://www.jetbrains.com/help/clion/code-coverage-clion.html
if(BUILD_COVERAGE)
set(COVERAGE_FLAGS ${CMAKE_CXX_FLAGS} "--coverage")

Expand Down
5 changes: 4 additions & 1 deletion docs/markdown/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html
Short tutorial: (Series: 1,2,3)
https://medium.com/heuristics/c-application-development-part-1-project-structure-454b00f9eddc
Shared libraries/rpaths/...
https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
```

## Requirements
Expand All @@ -51,7 +54,7 @@ doxygen
### Sphinx

```
cd docs/source
cd docs/sphinx/source
make clean; make html
```

Expand Down
186 changes: 94 additions & 92 deletions docs/markdown/eddl_progress_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,30 +424,30 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| zeros | ✔️ | ✔️ | needs comments in the .h |
| ones | ✔️ | ✔️ | needs comments in the .h |
| full | ✔️ | ✔️ | needs comments in the .h |
| eye | | ✔️ | needs comments in the .h |
| identity | ✔️ | ✔️ | needs comments in the .h |
| zeros | ✔️ | ✔️ | |
| ones | ✔️ | ✔️ | |
| full | ✔️ | ✔️ | |
| eye | | ✔️ | |
| identity | ✔️ | ✔️ | |

### From existing data

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| clone | | ✔️ | needs comments in the .h |
| clone | | ✔️ | |
| reallocate | ❌️ | ✔️ | needs comments in the .h |
| copy | | ✔️ | needs comments in the .h |
| copy | | ✔️ | |


### Numerical ranges

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| arange | | ✔️ | needs comments in the .h |
| range | | ✔️ | needs comments in the .h |
| linspace | | ✔️ | needs comments in the .h |
| logspace | | ✔️ | needs comments in the .h |
| geomspace | | ✔️ | needs comments in the .h |
| arange | | ✔️ | |
| range | | ✔️ | |
| linspace | | ✔️ | |
| logspace | | ✔️ | |
| geomspace | | ✔️ | |

### Random

Expand All @@ -460,7 +460,7 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| diag | | ✔️ | needs comments in the .h |
| diag | | ✔️ | |


## Manipulation
Expand All @@ -477,8 +477,8 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| reshape | | ✔️ | needs comments in the .h |
| flatten | | ✔️ | needs comments in the .h |
| reshape | | ✔️ | |
| flatten | | ✔️ | |

### Transpose-like operations

Expand All @@ -505,20 +505,20 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| shift | | ✔️ | needs comments in the .h |
| rotate | | ✔️ | needs comments in the .h |
| scale | | ✔️ | needs comments in the .h |
| flip | | ✔️ | needs comments in the .h |
| crop | | ✔️ | needs comments in the .h |
| crop_scale | | ✔️ | needs comments in the .h |
| cutout | | ✔️ | needs comments in the .h |
| shift_random | | ✔️ | needs comments in the .h |
| rotate_random || ✔️ | needs comments in the .h |
| scale_random | | ✔️ | needs comments in the .h |
| flip_random | | ✔️ | needs comments in the .h |
| crop_random | | ✔️ | needs comments in the .h |
| crop_scale_random| | ✔️ | needs comments in the .h |
| cutout_random || ✔️ | needs comments in the .h |
| shift | | ✔️ | |
| rotate | | ✔️ | |
| scale | | ✔️ | |
| flip | | ✔️ | |
| crop | | ✔️ | |
| crop_scale | | ✔️ | |
| cutout | | ✔️ | |
| shift_random | | ✔️ | |
| rotate_random || ✔️ | |
| scale_random | | ✔️ | |
| flip_random | | ✔️ | |
| crop_random | | ✔️ | |
| crop_scale_random| | ✔️ | |
| cutout_random || ✔️ | |


## Binary operations ❌️
Expand All @@ -538,7 +538,7 @@ empty ❌
### Indexing-like operations
| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| select | ✔️ | ✔️ | needs comments in the .h |
| select | ✔️ | ✔️ | |
| set_select | ❌️ | ✔️ | needs comments in the .h <br/> Confusing explanation |


Expand All @@ -549,20 +549,20 @@ empty ❌
### Input
| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| loadfs | ✔️ | ✔️ | needs comments in the .h |
| load | ✔️ | ✔️ | needs comments in the .h |
| load_from_txt |✔️ | ✔️ | needs comments in the .h |
| loadfs | ✔️ | ✔️ | |
| load | ✔️ | ✔️ | |
| load_from_txt |✔️ | ✔️ | |

### Output

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| savefs | ✔️ | ✔️ | needs comments in the .h <br/> Note: ONNX not yet implemented |
| save | ✔️ | ✔️ | needs comments in the .h <br/> Note: ONNX not yet implemented |
| save2txt | ✔️ | ✔️ | needs comments in the .h <br/> Check parameter explanation |
| savefs | ✔️ | ✔️ | Note: ONNX not yet implemented |
| save | ✔️ | ✔️ | Note: ONNX not yet implemented |
| save2txt | ✔️ | ✔️ | Check parameter explanation |


## Linar algebra
## Linear algebra

* note: section in progress

Expand All @@ -581,18 +581,18 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| all | ✔️ | ✔️ | needs comments in the .h |
| any | ✔️ | ✔️ | needs comments in the .h |
| all | ✔️ | ✔️ | |
| any | ✔️ | ✔️ | |

### Array contents

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| isfinite | ✔️ | ✔️ | needs comments in the .h |
| isinf | ✔️ | ✔️ | needs comments in the .h |
| isnan | ✔️ | ✔️ | needs comments in the .h |
| isneginf | ✔️ | ✔️ | needs comments in the .h |
| isposinf | ✔️ | ✔️ | needs comments in the .h |
| isfinite | ✔️ | ✔️ | |
| isinf | ✔️ | ✔️ | |
| isnan | ✔️ | ✔️ | |
| isneginf | ✔️ | ✔️ | |
| isposinf | ✔️ | ✔️ | |

### Logical operations

Expand Down Expand Up @@ -628,50 +628,52 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| abs | ❌️ | ✔️ | needs comments in the .h |
| acos | ❌️ | ✔️ | needs comments in the .h |
| add | ❌️ | ✔️ | needs comments in the .h <br/> three instructions |
| asin | ❌️ | ✔️ | needs comments in the .h |
| atan | ❌️ | ✔️ | needs comments in the .h |
| ceil | ❌️ | ✔️ | needs comments in the .h |
| clamp | ❌️ | ✔️ | needs comments in the .h |
| clampmax | ❌️ | ✔️ | needs comments in the .h |
| clampmin | ❌️ | ✔️ | needs comments in the .h |
| cos | ❌️ | ✔️ | needs comments in the .h |
| cosh | ❌️ | ✔️ | needs comments in the .h |
| div | ❌️ | ✔️ | needs comments in the .h <br/> two instructions |
| exp | ❌️ | ✔️ | needs comments in the .h |
| floor | ❌️ | ✔️ | needs comments in the .h |
| log | ❌️ | ✔️ | needs comments in the .h |
| log2 | ❌️ | ✔️ | needs comments in the .h |
| log10 | ❌️ | ✔️ | needs comments in the .h |
| logn | ❌️ | ✔️ | needs comments in the .h |
| mod | ❌️ | ✔️ | needs comments in the .h |
| mult | ❌️ | ✔️ | needs comments in the .h <br/> two instructions |
| neg | ❌️ | ✔️ | needs comments in the .h |
| abs | ✔️ | ✔️ | |
| acos | ✔️ | ✔️ | |
| add | ✔️ | ✔️ | |
| asin | ✔️ | ✔️ | |
| atan | ✔️ | ✔️ | |
| ceil | ✔️ | ✔️ | |
| clamp | ✔️ | ✔️ | |
| clampmax | ✔️ | ✔️ | |
| clampmin | ✔️ | ✔️ | |
| cos | ✔️ | ✔️ | |
| cosh | ✔️ | ✔️ | |
| div | ✔️ | ✔️ | |
| exp | ✔️ | ✔️ | |
| floor | ✔️ | ✔️ | |
| log | ✔️ | ✔️ | |
| log2 | ✔️ | ✔️ | |
| log10 | ✔️ | ✔️ | |
| logn | ✔️ | ✔️ | |
| mod | ✔️ | ✔️ | |
| mult | ✔️ | ✔️ | |
| normalize | ❌️ | ✔️ | needs comments in the .h <br/> two instructions |
| neg | ✔️ | ✔️ | |
| pow | ❌️ | ✔️ | needs comments in the .h |
| powb | ❌️ | ✔️ | needs comments in the .h |
| reciprocal | ❌️ | ✔️ | needs comments in the .h |
| remainder | | ✔️ | needs comments in the .h |
| round | | ✔️ | needs comments in the .h |
| rsqrt | | ✔️ | needs comments in the .h |
| sigmoid | | ✔️ | needs comments in the .h |
| sign | | ✔️ | needs comments in the .h <br/> two instructions |
| sin | | ✔️ | needs comments in the .h |
| sinh | | ✔️ | needs comments in the .h |
| remainder | | ✔️ | |
| round | | ✔️ | |
| rsqrt | | ✔️ | |
| sigmoid | | ✔️ | |
| sign | | ✔️ | |
| sin | | ✔️ | |
| sinh | | ✔️ | |
| sqr | ❌️ | ✔️ | needs comments in the .h |
| sqrt | | ✔️ | needs comments in the .h |
| sub | | ✔️ | needs comments in the .h |
| sum | | ✔️ | needs comments in the .h <br/> three different instructions |
| tan | | ✔️ | needs comments in the .h |
| tanh | | ✔️ | needs comments in the .h |
| trunc | | ✔️ | needs comments in the .h |
| sqrt | | ✔️ | |
| sub | | ✔️ | |
| sum | | ✔️ | |
| tan | | ✔️ | |
| tanh | | ✔️ | |
| trunc | | ✔️ | |

### Reductions

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| max | | ✔️ | needs comments in the .h |
| min | | ✔️ | needs comments in the .h |
| max | | ✔️ | |
| min | | ✔️ | |


## Miscellaneous
Expand All @@ -682,15 +684,15 @@ empty ❌

| Section | Explanation | Instructions | Comments |
| :------ | :---------: | :----------: | :------- |
| toCPU | | ✔️ | needs comments in the .h |
| toGPU | | ✔️ | needs comments in the .h |
| isCPU | | ✔️ | needs comments in the .h |
| isGPU | | ✔️ | needs comments in the .h |
| isFPGA | | ✔️ | needs comments in the .h |
| isSquared | | ✔️ | needs comments in the .h |
| copy | | ✔️ | needs comments in the .h |
| clone | | ✔️ | needs comments in the .h |
| info | | ✔️ | needs comments in the .h |
| print | | ✔️ | needs comments in the .h |
| valid_indices | | ✔️ | needs comments in the .h |
| get_address_rowmajor || ✔️ | needs comments in the .h |
| toCPU | | ✔️ | |
| toGPU | | ✔️ | |
| isCPU | | ✔️ | |
| isGPU | | ✔️ | |
| isFPGA | | ✔️ | |
| isSquared | | ✔️ | |
| copy | | ✔️ | |
| clone | | ✔️ | |
| info | | ✔️ | |
| print | | ✔️ | |
| valid_indices | | ✔️ | |
| get_address_rowmajor || ✔️ | |
28 changes: 14 additions & 14 deletions docs/sphinx/source/bundle/computing_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ CPU
Example:

.. code-block:: c++
:linenos:

compserv CS_CPU(int th=-1, string mem="low_mem");

build(net,
rmsprop(0.01), // Optimizer
{"soft_cross_entropy"}, // Losses
{"categorical_accuracy"}, // Metrics
CS_CPU(4), // CPU with 4 threads
false
);


GPU
Expand All @@ -24,12 +28,14 @@ GPU
Example:

.. code-block:: c++
:linenos:

compserv CS_GPU(const vector<int> g={1}, int lsb=1, string mem="low_mem");

compserv CS_GPU(const vector<int> g={1}, string mem="low_mem");

build(imported_net,
rmsprop(0.01), // Optimizer
{"soft_cross_entropy"}, // Losses
{"categorical_accuracy"}, // Metrics
CS_GPU({1}), // one GPU
false
);


FPGA
Expand Down Expand Up @@ -60,9 +66,3 @@ COMPSS
**Not implemented yet**


Example:

.. code-block:: c++
:linenos:

compserv CS_COMPSS(string filename);
16 changes: 12 additions & 4 deletions docs/sphinx/source/datasets/classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ Dataset of 60,000 28x28 grayscale images of the 10 digits, along with a test set
Example:

.. code-block:: c++
:linenos:

void download_mnist();
download_mnist();

Tensor* x_train = Tensor::load("mnist_trX.bin");
Tensor* y_train = Tensor::load("mnist_trY.bin");
Tensor* x_test = Tensor::load("mnist_tsX.bin");
Tensor* y_test = Tensor::load("mnist_tsY.bin");


CIFAR-10
Expand All @@ -30,6 +34,10 @@ Dataset of 50,000 32x32 color training images, labeled over 10 categories, and 1
Example:

.. code-block:: c++
:linenos:

void download_cifar10();
download_cifar10();

Tensor* x_train = Tensor::load("cifar_trX.bin");
Tensor* y_train = Tensor::load("cifar_trY.bin");
Tensor* x_test = Tensor::load("cifar_tsX.bin");
Tensor* y_test = Tensor::load("cifar_tsY.bin");
Loading

0 comments on commit 06043a9

Please sign in to comment.