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
#!/bin/bash | |
# ============================================================================= | |
# Install AzCopy on Linux | |
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10 | |
# https://github.com/Azure/azure-storage-azcopy | |
# ----------------------------------------------------------------------------- | |
# Developer.......: Andre Essing (https://www.andre-essing.de/) | |
# (https://github.com/aessing) | |
# (https://twitter.com/aessing) | |
# (https://www.linkedin.com/in/aessing/) |
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
import argparse | |
from pathlib import Path | |
import timm | |
import timm.data | |
import timm.loss | |
import timm.optim | |
import timm.utils | |
import torch | |
import torchmetrics |
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
from pathlib import Path | |
from timm.data.parsers.parser import Parser | |
class ParserImageName(Parser): | |
def __init__(self, root, class_to_idx=None): | |
super().__init__() | |
self.root = Path(root) |
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
from pytorch_accelerated.callbacks import TrainerCallback | |
import torchmetrics | |
class RecommenderMetricsCallback(TrainerCallback): | |
def __init__(self): | |
self.metrics = torchmetrics.MetricCollection( | |
{ | |
"mse": torchmetrics.MeanSquaredError(), | |
"mae": torchmetrics.MeanAbsoluteError(), | |
} |
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 | |
from torch import nn | |
class MfDotBias(nn.Module): | |
def __init__( | |
self, n_factors, n_users, n_items, ratings_range=None, use_biases=True | |
): | |
super().__init__() | |
self.bias = use_biases |
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
# https://github.com/Chris-hughes10/pytorch-accelerated/blob/main/examples/metrics/train_with_metrics_in_callback.py | |
import os | |
from torch import nn, optim | |
from torch.utils.data import random_split | |
from torchmetrics import MetricCollection, Accuracy, Precision, Recall | |
from torchvision import transforms | |
from torchvision.datasets import MNIST |
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
from torchmetrics import MetricCollection, Accuracy, Precision, Recall | |
from pytorch_accelerated.callbacks import TrainerCallback | |
class ClassificationMetricsCallback(TrainerCallback): | |
def __init__(self, num_classes): | |
self.metrics = MetricCollection( | |
{ | |
"accuracy": Accuracy(num_classes=num_classes), |
NewerOlder