homa 0.2.93__tar.gz → 0.2.96__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {homa-0.2.93 → homa-0.2.96}/PKG-INFO +1 -1
- {homa-0.2.93 → homa-0.2.96}/pyproject.toml +1 -1
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/StoresModels.py +10 -3
- homa-0.2.96/src/homa/ensemble/utils.py +9 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa.egg-info/PKG-INFO +1 -1
- {homa-0.2.93 → homa-0.2.96}/src/homa.egg-info/SOURCES.txt +1 -0
- {homa-0.2.93 → homa-0.2.96}/README.md +0 -0
- {homa-0.2.93 → homa-0.2.96}/setup.cfg +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/APLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ActivationFunction.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/AdaptiveActivationFunction.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/BaseDLReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/CaLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/DLReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ERF.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/Elliot.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ExpExpish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ExponentialDLReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ExponentialSwish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/GCU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/GaLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/GaussianReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/GeneralizedSwish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/Gish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/LaLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/LogLogish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/LogSigmoid.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/Logish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/MeLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/MexicanReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/MinSin.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/NReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/NoisyReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/PLogish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ParametricLogish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/Phish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/RReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/RandomizedSlopedReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SGELU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SelfArctan.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/ShiftedReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SigmoidDerivative.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SineReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SlopedReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SmallGaLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/Smish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/SoftsignRReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/Suish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/TBSReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/TSReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/TangentBipolarSigmoidReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/TangentSigmoidReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/TeLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/TripleStateSwish.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/WideMeLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/AOAF.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/AReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/DPReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/DualLine.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/FReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/LeLeLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/PERU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/PiLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/ShiLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/StarReLU.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/concerns/ChannelBased.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/activations/learnable/concerns/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/Commands/Command.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/Commands/InitCommand.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/Commands/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/HomaCommand.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/namespaces/CacheNamespace.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/namespaces/MakeNamespace.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/cli/namespaces/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/device.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/Ensemble.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/CalculatesMetricNecessities.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/PredictsProbabilities.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/ReportsClassificationMetrics.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/ReportsEnsembleAccuracy.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/ReportsEnsembleF1.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/ReportsEnsembleKappa.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/ReportsLogits.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/ReportsSize.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/ensemble/concerns/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/loss/LogitNormLoss.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/loss/Loss.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/loss/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/settings.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/torch/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/torch/helpers.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/utils.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/Classifier.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/Model.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/Resnet.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/StochasticClassifier.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/StochasticSwin.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/Swin.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/HasLabels.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/HasLogits.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/HasProbabilities.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/ReportsAccuracy.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/ReportsMetrics.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/Trainable.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/concerns/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/modules/ResnetModule.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/modules/SwinModule.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/modules/__init__.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa/vision/utils.py +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa.egg-info/dependency_links.txt +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa.egg-info/entry_points.txt +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa.egg-info/requires.txt +0 -0
- {homa-0.2.93 → homa-0.2.96}/src/homa.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "homa"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.96"
|
|
8
8
|
description = "A curated list of machine learning and deep learning helpers."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name="Taha Shieenavaz", email="tahashieenavaz@gmail.com" },
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import torch
|
|
2
|
-
|
|
2
|
+
import io
|
|
3
3
|
from typing import List
|
|
4
4
|
from ...vision import Model
|
|
5
|
+
from ..utils import get_model_device
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class StoresModels:
|
|
@@ -12,11 +13,17 @@ class StoresModels:
|
|
|
12
13
|
def record(self, model: Model | torch.nn.Module):
|
|
13
14
|
model_: torch.nn.Module | None = None
|
|
14
15
|
if isinstance(model, Model):
|
|
15
|
-
model_ =
|
|
16
|
+
model_ = model.network
|
|
16
17
|
elif isinstance(model, torch.nn.Module):
|
|
17
|
-
model_ =
|
|
18
|
+
model_ = model
|
|
18
19
|
else:
|
|
19
20
|
raise TypeError("Wrong input to ensemble record")
|
|
21
|
+
|
|
22
|
+
device = get_model_device(model_)
|
|
23
|
+
buffer = io.BytesIO()
|
|
24
|
+
torch.save(model_.to("cpu"), buffer)
|
|
25
|
+
buffer.seek(0)
|
|
26
|
+
model_ = torch.load(buffer, map_location=device)
|
|
20
27
|
self.models.append(model_)
|
|
21
28
|
|
|
22
29
|
def push(self, *args, **kwargs):
|
|
@@ -81,6 +81,7 @@ src/homa/cli/namespaces/MakeNamespace.py
|
|
|
81
81
|
src/homa/cli/namespaces/__init__.py
|
|
82
82
|
src/homa/ensemble/Ensemble.py
|
|
83
83
|
src/homa/ensemble/__init__.py
|
|
84
|
+
src/homa/ensemble/utils.py
|
|
84
85
|
src/homa/ensemble/concerns/CalculatesMetricNecessities.py
|
|
85
86
|
src/homa/ensemble/concerns/PredictsProbabilities.py
|
|
86
87
|
src/homa/ensemble/concerns/ReportsClassificationMetrics.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|