7 Commits
dev ... v0.5.4

Author SHA1 Message Date
Alexander Engelsberger
87fa3f0729 build: bump version 0.5.3 → 0.5.4 2023-03-02 17:29:54 +00:00
Alexander Engelsberger
08db94d507 fix: fix entrypoint configuration 2023-03-02 17:29:23 +00:00
Alexander Engelsberger
8ecf9948b2 build: bump version 0.5.2 → 0.5.3 2023-03-02 17:24:11 +00:00
Alexander Engelsberger
c5f0b86114 chore: upgrade pre commit 2023-03-02 17:23:41 +00:00
Alexander Engelsberger
7506614ada fix: Update dependency versions 2023-03-02 17:05:39 +00:00
Alexander Engelsberger
fcd944d3ff build: bump version 0.5.1 → 0.5.2 2022-06-01 14:25:44 +02:00
Alexander Engelsberger
054720dd7b fix(hotfix): Protobuf error workaround 2022-06-01 14:14:57 +02:00
9 changed files with 20 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.1
current_version = 0.5.4
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)

View File

@@ -3,7 +3,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -13,17 +13,17 @@ repos:
- id: check-case-conflict
- repo: https://github.com/myint/autoflake
rev: v1.4
rev: v2.0.1
hooks:
- id: autoflake
- repo: http://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.950
rev: v1.0.1
hooks:
- id: mypy
files: prototorch
@@ -35,14 +35,14 @@ repos:
- id: yapf
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- id: python-no-log-warn
- id: python-check-blanket-noqa
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.3.1
hooks:
- id: pyupgrade

View File

@@ -23,7 +23,7 @@ author = "Jensun Ravichandran"
# The full version, including alpha/beta/rc tags
#
release = "0.5.1"
release = "0.5.4"
# -- General configuration ---------------------------------------------------

View File

@@ -36,4 +36,4 @@ from .unsupervised import (
)
from .vis import *
__version__ = "0.5.1"
__version__ = "0.5.4"

View File

@@ -205,7 +205,7 @@ class SupervisedPrototypeModel(PrototypeModel):
self.log("test_acc", accuracy)
class ProtoTorchMixin(object):
class ProtoTorchMixin:
"""All mixins are ProtoTorchMixins."""

View File

@@ -39,7 +39,7 @@ def ltangent_distance(x, y, omegas):
:param `torch.tensor` omegas: Three dimensional matrix
:rtype: `torch.tensor`
"""
x, y = [arr.view(arr.size(0), -1) for arr in (x, y)]
x, y = (arr.view(arr.size(0), -1) for arr in (x, y))
p = torch.eye(omegas.shape[-2], device=omegas.device) - torch.bmm(
omegas, omegas.permute([0, 2, 1]))
projected_x = x @ p

View File

@@ -145,7 +145,7 @@ class SiameseGLVQ(GLVQ):
def compute_distances(self, x):
protos, _ = self.proto_layer()
x, protos = [arr.view(arr.size(0), -1) for arr in (x, protos)]
x, protos = (arr.view(arr.size(0), -1) for arr in (x, protos))
latent_x = self.backbone(x)
bb_grad = any([el.requires_grad for el in self.backbone.parameters()])

View File

@@ -21,3 +21,7 @@ include_trailing_comma = True
force_grid_wrap = 3
use_parentheses = True
line_length = 79
[mypy]
explicit_package_bases = True
namespace_packages = True

View File

@@ -18,13 +18,14 @@ PLUGIN_NAME = "models"
PROJECT_URL = "https://github.com/si-cim/prototorch_models"
DOWNLOAD_URL = "https://github.com/si-cim/prototorch_models.git"
with open("README.md", "r") as fh:
with open("README.md") as fh:
long_description = fh.read()
INSTALL_REQUIRES = [
"prototorch>=0.7.3",
"pytorch_lightning>=1.6.0",
"torchmetrics",
"torchmetrics<0.10.0",
"protobuf<3.20.0",
]
CLI = [
"jsonargparse",
@@ -54,7 +55,7 @@ ALL = CLI + DEV + DOCS + EXAMPLES + TESTS
setup(
name=safe_name("prototorch_" + PLUGIN_NAME),
version="0.5.1",
version="0.5.4",
description="Pre-packaged prototype-based "
"machine learning models using ProtoTorch and PyTorch-Lightning.",
long_description=long_description,