Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Remove clustpy via pip to avoid ambiguities during development, e.g., when chang
| ENRC | [Deep Embedded Non-Redundant Clustering](https://ojs.aaai.org/index.php/AAAI/article/view/5961) | AAAI 2020 | [Link](https://gitlab.cs.univie.ac.at/lukas/enrcpublic) (Python + PyTorch) | [Link](https://clustpy.readthedocs.io/en/latest/clustpy.deep.html#clustpy.deep.enrc.ENRC) |
| IDEC | [Improved Deep Embedded Clustering with Local Structure Preservation](https://www.ijcai.org/proceedings/2017/243) | IJCAI 2017 | [Link](https://github.com/XifengGuo/IDEC) (Python + Keras) | [Link](https://clustpy.readthedocs.io/en/latest/clustpy.deep.html#clustpy.deep.dec.IDEC) |
| N2D | [N2d:(not too) deep clustering via clustering the local manifold of an autoencoded embedding](https://ieeexplore.ieee.org/document/9413131) | ICPR 2021 | [Link](https://github.com/XifengGuo/IDEC) (Python + Keras) | [Link](https://clustpy.readthedocs.io/en/latest/clustpy.deep.html#clustpy.deep.ddc_n2d.N2D) |
| SHADE | [SHADE: Deep Density-based Clustering](https://ieeexplore.ieee.org/abstract/document/10884477) | ICDM 2024 | [Link](https://github.com/pasiweber/SHADE) (Python + PyTorch) | [Link](https://clustpy.readthedocs.io/en/latest/clustpy.deep.html#clustpy.deep.shade.SHADE) |
| VaDE | [Variational Deep Embedding: An Unsupervised and Generative Approach to Clustering](https://www.ijcai.org/proceedings/2017/0273) | IJCAI 2017 | [Link](https://github.com/slim1017/VaDE) (Python + Keras) | [Link](https://clustpy.readthedocs.io/en/latest/clustpy.deep.html#clustpy.deep.vade.VaDE) |

#### Neural Networks
Expand Down
2 changes: 2 additions & 0 deletions clustpy/deep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .aec import AEC
from .deepect import DeepECT
from .den import DEN
from .shade import SHADE
from ._data_utils import get_dataloader, get_default_augmented_dataloaders
from ._train_utils import get_trained_network, get_neural_network
from ._utils import encode_batchwise, decode_batchwise, encode_decode_batchwise, predict_batchwise, detect_device, \
Expand All @@ -28,6 +29,7 @@
'DipEncoder',
'DeepECT',
'DEN',
'SHADE',
'get_dataloader',
'get_default_augmented_dataloaders',
'get_neural_network'
Expand Down
5 changes: 0 additions & 5 deletions clustpy/deep/_abstract_deep_clustering_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ def transform(self, X: np.ndarray) -> np.ndarray:
"""
check_is_fitted(self, ["labels_", "neural_network_trained_", "n_features_in_"])
X, _, _ = check_parameters(X, allow_size_1=True, allow_nd=self.neural_network_trained_.allow_nd_input, estimator_obj=self)
if X.shape[1] != self.n_features_in_:
raise ValueError(
f"X has {X.shape[1]} features, but {self.__class__.__name__} "
f"is expecting {self.n_features_in_} features as input."
)
X_embed = self.neural_network_trained_.transform(X)
return X_embed

Expand Down
2 changes: 1 addition & 1 deletion clustpy/deep/_train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def get_trained_network(trainloader: torch.utils.data.DataLoader = None, data: n
neural_network = get_neural_network(input_dim, embedding_size, neural_network, neural_network_class,
neural_network_params, neural_network_weights, device, random_state)
# Start training
if not neural_network.fitted:
if not neural_network.fitted and n_epochs > 0:
print("Neural network is not fitted yet, will be pretrained.")
# Pretrain neural network
optimizer_params = {"lr": 1e-3} if optimizer_params is None else optimizer_params
Expand Down
Loading
Loading