This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ants | |
import click | |
import numpy as np | |
from rich.console import Console | |
from rich.table import Table | |
CLASS_LABELS = ["Dentate Gyrus", "CA1", "CA2", "CA3", "Subiculum"] | |
@click.command() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Clément POIRET <poiret dot clement at outlook dot fr> | |
_pkgname="hyprland" | |
pkgname="${_pkgname}-displaylink-git" | |
pkgver="0.38.1" | |
pkgrel=1 | |
pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks. (DisplayLink patch)" | |
arch=(any) | |
url="https://github.com/hyprwm/Hyprland" | |
license=('BSD') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import pandas as pd | |
import numpy as np | |
import pingouin as pg | |
from scipy.stats import pearsonr | |
def mse(y, y_hat): | |
"""Let's define a dummy error term :)""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import pymia.evaluation.evaluator as eval_ | |
import pymia.evaluation.metric as metric | |
y = torch.randint(0, 4, (1, 16, 16, 16)) | |
y_hat = y * .8 - 1 | |
metrics = [ | |
metric.DiceCoefficient(), | |
metric.VolumeSimilarity(), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prediction | |
observation = np.array(1).reshape(-1,1) | |
y_pred = model.predict(observation) | |
y_truth = gradient * observation + w0 | |
print("Prediction : {}\nTruth : {}".format(y_pred, y_truth)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Showing data, alongside prediction | |
x = np.linspace(0, 2, 10).reshape(-1, 1) | |
y_truth = gradient * x + w0 | |
y_estimated = model.coef_ * x + model.intercept_ | |
plt.scatter(X_train, y_train, label="Data") | |
plt.plot(x, y_truth, label="Truth") | |
plt.plot(x, y_estimated, label="Model") | |
plt.legend(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Model's Definition and Training | |
model = LinearRegression(fit_intercept = True) | |
model.fit(X_train, y_train) | |
# Creating test sets | |
X_test = 2 * np.random.random_sample((10, 1)) | |
y_test = gradient * X_test + w0 + 0.1 * np.random.random_sample((10, 1)) | |
# Score | |
r2 = model.score(X_test, y_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Model's Definition and Training | |
model = LinearRegression(fit_intercept = True) | |
model.fit(X_train, y_train) | |
# Creating test sets | |
X_test = 2 * np.random.random_sample((10, 1)) | |
y_test = gradient * X_test + w0 + 0.1 * np.random.random_sample((10, 1)) | |
# Score | |
r2 = model.score(X_test, y_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Real Parameters | |
gradient = 0.5 | |
w0 = 1 | |
# Data synthesis | |
X_train = 2 * np.random.random_sample((20, 1)) | |
y_train = gradient * X_train + w0 + 0.1 * np.random.random_sample((20, 1)) | |
# Plot | |
plt.scatter(X_train, y_train); |
NewerOlder