Skip to content

Commit

Permalink
Improved CLS init for DL_matlab methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Feb 10, 2020
1 parent a5c49ad commit 2566b8a
Show file tree
Hide file tree
Showing 41 changed files with 1,213 additions and 2,219 deletions.
4 changes: 2 additions & 2 deletions docs/source/api/restore/DL_ITKrMM_matlab.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inpystem.restore.DL_ITKrMM module
===================================
inpystem.restore.DL_ITKrMM_matlab module
===========================================

.. automodule:: inpystem.restore.DL_ITKrMM_matlab

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/tools/PCA.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inpystem.tools.PCA module
=======================
=========================

.. automodule:: inpystem.tools.PCA

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/tools/dct.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inpystem.tools.dct module
=======================
=========================

.. automodule:: inpystem.tools.dct

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/tools/matlab_interface.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inpystem.tools.matlab_interface module
====================================
======================================

.. automodule:: inpystem.tools.matlab_interface
:members:
10 changes: 5 additions & 5 deletions docs/source/user/restoration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ Restoration cheet sheet
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| :code:`Post_LS_CLS` | | x | :code:`Lambda`, :code:`Nit`, :code:`init` | :code:`E_CLS`, :code:`E_post_ls`, :code:`Gamma`, :code:`nnz_ratio`, :code:`time` |
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| :code:`ITKrMM` | x | x | :code:`PatchSize`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
| :code:`ITKrMM` | x | x | :code:`P`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| :code:`ITKrMM_matlab` | x | x | :code:`PatchSize`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
| :code:`ITKrMM_matlab` | x | x | :code:`P`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| :code:`wKSVD` | x | x | :code:`PatchSize`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
| :code:`wKSVD` | x | x | :code:`P`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| :code:`wKSVD_matlab` | x | x | :code:`PatchSize`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
| :code:`wKSVD_matlab` | x | x | :code:`P`, :code:`K`, :code:`L`, :code:`S`, :code:`Nit_lr`, :code:`Nit`, :code:`init`, :code:`CLS_init` | :code:`dico`, :code:`E`, :code:`time` |
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| :code:`BPFA_matlab` | x | x | :code:`PatchSize`, :code:`K`, :code:`step`, :code:`Nit` | :code:`dico`, :code:`time` |
| :code:`BPFA_matlab` | x | x | :code:`P`, :code:`K`, :code:`step`, :code:`Nit` | :code:`dico`, :code:`time` |
+-----------------------+----+----+-----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+


Expand Down
10 changes: 5 additions & 5 deletions inpystem/restore/DL_BPFA.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ..tools import matlab_interface as matlab


def BPFA_matlab(Y, mask, PatchSize=5, Omega=1, K=128, Nit=100, step=1,
def BPFA_matlab(Y, mask, P=5, Omega=1, K=128, Nit=100, step=1,
PCA_transform=True, PCA_th='auto', verbose=True):
"""Implements BPFA algorithm for python.
Expand All @@ -25,7 +25,7 @@ def BPFA_matlab(Y, mask, PatchSize=5, Omega=1, K=128, Nit=100, step=1,
The input data.
mask: (m, n) numpy array
The acquisition mask.
PatchSize: int
P: int
The patch width.
Default is 5.
Omega: int
Expand Down Expand Up @@ -97,7 +97,7 @@ def BPFA_matlab(Y, mask, PatchSize=5, Omega=1, K=128, Nit=100, step=1,
# Arguments.
Dico = {'Y': Y_PCA,
'mask': mask,
'PatchSize': PatchSize,
'P': P,
'Omega': Omega,
'K': K,
'iter': Nit,
Expand All @@ -122,8 +122,8 @@ def BPFA_matlab(Y, mask, PatchSize=5, Omega=1, K=128, Nit=100, step=1,

# Create output dico
# Reshape output dico
shape_dico = (K, PatchSize, PatchSize) if Y.ndim == 2 else (
K, PatchSize, PatchSize, Y_PCA.shape[-1])
shape_dico = (K, P, P) if Y.ndim == 2 else (
K, P, P, Y_PCA.shape[-1])
dico = dico_hat.T.reshape(shape_dico)

# Create output data
Expand Down

0 comments on commit 2566b8a

Please sign in to comment.