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 pandas as pd | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import accuracy_score | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import numpy as np | |
from torch.autograd import Variable | |
from sklearn import preprocessing | |
from torch.utils.data import DataLoader, TensorDataset |
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 io | |
import copy | |
import torch | |
# Make use of a GPU or MPS (Apple) if one is available. | |
device = "mps" if getattr(torch,'has_mps',False) \ | |
else "cuda" if torch.cuda.is_available() else "cpu" | |
class EarlyStopping(): |
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
# What version of Python do you have? | |
import sys | |
import platform | |
import torch | |
import pandas as pd | |
import sklearn as sk | |
has_gpu = torch.cuda.is_available() | |
has_mps = getattr(torch,'has_mps',False) | |
device = "mps" if getattr(torch,'has_mps',False) \ |
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
name: torch | |
channels: | |
- pytorch-nightly | |
- conda-forge | |
dependencies: | |
- python=3.9 | |
- pip>=19.0 | |
- pytorch | |
- torchvision | |
- jupyter |
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
# What version of Python do you have? | |
import sys | |
import tensorflow.keras | |
import pandas as pd | |
import sklearn as sk | |
import tensorflow as tf | |
import platform | |
print(f"Python Platform: {platform.platform()}") |
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
name: tensorflow | |
channels: | |
- apple | |
- conda-forge | |
dependencies: | |
- python=3.9 | |
- pip>=19.0 | |
- jupyter | |
- tensorflow-deps | |
- scikit-learn |
NewerOlder