Skip to content

Instantly share code, notes, and snippets.

View aryan-jadon's full-sized avatar
😀

Aryan Jadon aryan-jadon

😀
View GitHub Profile
@aryan-jadon
aryan-jadon / NeturalNetwork.py
Created September 15, 2022 05:01
NeturalNetwork.py
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
@aryan-jadon
aryan-jadon / EarlyStoppingClass.py
Created September 15, 2022 04:49
EarlyStoppingClass.py
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():
@aryan-jadon
aryan-jadon / pytorch_check.py
Created September 13, 2022 23:04
Apple Mac PyTorch Check
# 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) \
@aryan-jadon
aryan-jadon / pytorch-apple-metal.yml
Created September 13, 2022 23:01
pytorch apple m1 dependencies
name: torch
channels:
- pytorch-nightly
- conda-forge
dependencies:
- python=3.9
- pip>=19.0
- pytorch
- torchvision
- jupyter
@aryan-jadon
aryan-jadon / tensorflow_check.py
Created September 12, 2022 22:34
script to test packages versions after installation
# 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()}")
@aryan-jadon
aryan-jadon / tensorflow-apple-metal.yml
Created September 12, 2022 22:28
Apple Mac Tensorflow Dependencies
name: tensorflow
channels:
- apple
- conda-forge
dependencies:
- python=3.9
- pip>=19.0
- jupyter
- tensorflow-deps
- scikit-learn