Skip to content

Commit

Permalink
Merge pull request #129 from geometric-intelligence/ninamiolane-doc
Browse files Browse the repository at this point in the history
Fix some lint errors + test doc website
  • Loading branch information
ninamiolane authored Apr 6, 2024
2 parents 770fbcd + 5f69647 commit 7a4f64f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
26 changes: 11 additions & 15 deletions neurometry/datasets/synthetic.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import os

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs

#from geomstats.geometry.klein_bottle import KleinBottle
import torch
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.hypersphere import Hypersphere
from geomstats.geometry.product_manifold import ProductManifold

### Synthetic Latent Manifolds ###
import geomstats.backend as gs # noqa: E402
import torch # noqa: E402
from geomstats.geometry.euclidean import Euclidean # noqa: E402
from geomstats.geometry.hypersphere import Hypersphere # noqa: E402
from geomstats.geometry.klein_bottle import KleinBottle # noqa: E402
from geomstats.geometry.product_manifold import ProductManifold # noqa: E402


def synthetic_neural_manifold(
Expand Down Expand Up @@ -46,7 +43,7 @@ def synthetic_neural_manifold(
)
try:
noisy_points = poisson_spikes(manifold_points, poisson_multiplier)
except:
except Exception:
print("WARNING! Poisson spikes not generated: mean must be non-negative")
noisy_points = None

Expand Down Expand Up @@ -216,14 +213,13 @@ def apply_nonlinearity(encoded_points, nonlinearity, **kwargs):
"""
if nonlinearity == "relu":
return relu(encoded_points, **kwargs)
elif nonlinearity == "sigmoid":
if nonlinearity == "sigmoid":
return scaled_sigmoid(encoded_points, **kwargs)
elif nonlinearity == "tanh":
if nonlinearity == "tanh":
return scaled_tanh(encoded_points, **kwargs)
elif nonlinearity == "linear":
if nonlinearity == "linear":
return encoded_points
else:
raise ValueError("Nonlinearity not recognized")
raise ValueError("Nonlinearity not recognized")


def relu(tensor, threshold=0):
Expand Down
6 changes: 3 additions & 3 deletions neurometry/dimension/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import skdim

os.environ["GEOMSTATS_BACKEND"] = "pytorch"
import geomstats.backend as gs
import matplotlib.pyplot as plt
import geomstats.backend as gs # noqa: E402
import matplotlib.pyplot as plt # noqa: E402

import neurometry.datasets.synthetic as synthetic
import neurometry.datasets.synthetic as synthetic # noqa: E402


def skdim_dimension_estimation(
Expand Down

0 comments on commit 7a4f64f

Please sign in to comment.