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
# OAuth2.0 Version | |
import tweepy | |
#Put your Bearer Token in the parenthesis below | |
client = tweepy.Client(bearer_token='Change this') | |
""" | |
If you don't understand search queries, there is an excellent introduction to it here: | |
https://github.com/twitterdev/getting-started-with-the-twitter-api-v2-for-academic-research/blob/main/modules/5-how-to-write-search-queries.md | |
""" |
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
# OAuth2.0 Version | |
import tweepy | |
#Put your Bearer Token in the parenthesis below | |
client = tweepy.Client(bearer_token='Change this') | |
""" | |
If you don't understand search queries, there is an excellent introduction to it here: | |
https://github.com/twitterdev/getting-started-with-the-twitter-api-v2-for-academic-research/blob/main/modules/5-how-to-write-search-queries.md | |
""" |
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 sklearn.datasets import make_classification | |
from sklearn.model_selection import train_test_split | |
from xgboost import XGBClassifier | |
import time | |
# create synthetic dataset | |
X, y = make_classification(n_samples=100000, n_features=1000, n_informative=50, n_redundant=0, random_state=1) | |
# split data into training and test sets | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.50, random_state=1) |
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 ray_lightning import RayPlugin | |
import pytorch_lightning as pl | |
import torch | |
import torch.nn.functional as F | |
from torch.utils.data import random_split, DataLoader | |
from torchvision.datasets import MNIST | |
from torchvision import transforms | |
class LightningMNISTClassifier(pl.LightningModule): | |
def __init__(self, config, data_dir=None): |
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 ray_lightning import RayPlugin | |
import pytorch_lightning as pl | |
import torch | |
import torch.nn.functional as F | |
from torch.utils.data import random_split, DataLoader | |
from torchvision.datasets import MNIST | |
from torchvision import transforms | |
class LightningMNISTClassifier(pl.LightningModule): | |
def __init__(self, config, data_dir=None): |
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 = LightningMNISTClassifier(config, data_dir="./") | |
trainer = pl.Trainer( max_epochs=10) | |
trainer.fit(model) |
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 pytorch_lightning as pl | |
import torch | |
import torch.nn.functional as F | |
from torch.utils.data import random_split, DataLoader | |
from torchvision.datasets import MNIST | |
from torchvision import transforms | |
class LightningMNISTClassifier(pl.LightningModule): | |
def __init__(self, config, data_dir=None): | |
super(LightningMNISTClassifier, self).__init__() |
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
cluster_name: ml | |
# Cloud-provider specific configuration. | |
provider: | |
type: aws | |
region: us-west-2 | |
availability_zone: us-west-2a,us-west-2b | |
# How Ray will authenticate with newly launched nodes. | |
auth: |
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 math | |
import numpy as np | |
from timebudget import timebudget | |
import ipyparallel as ipp | |
iterations_count = round(1e7) | |
def complex_operation(input_index): | |
print("Complex operation. Input index: {:2d}".format(input_index)) |
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 math | |
import numpy as np | |
from timebudget import timebudget | |
from multiprocessing import Pool | |
iterations_count = round(1e7) | |
def complex_operation(input_index): | |
print("Complex operation. Input index: {:2d}".format(input_index)) |
NewerOlder