code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/tensorflow-install-mac-metal-jul-2021.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# T81-558: Applications of Deep Neural Networks
**Manual Python Setu... | github_jupyter |
# Introduction to Graph Matching
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```
The graph matching problem (GMP), is meant to find an allignment of nodes between two graphs that minimizes the number of edge disagreements between those two graphs. Therefore, the GMP can be formally writt... | github_jupyter |
```
cat ratings_train.txt | head -n 10
def read_data(filename):
with open(filename, 'r') as f:
data = [line.split('\t') for line in f.read().splitlines()]
# txt ํ์ผ์ ํค๋(id document label)๋ ์ ์ธํ๊ธฐ
data = data[1:]
return data
train_data = read_data('ratings_train.txt')
test_data = read_data(... | github_jupyter |
# VEHICLE_NUMBER_PLATE_RECOGNITION
## PART-1(DETECTION)
#### 1. Importing required Libraries
```
! pip install pydrive
import os
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
# 1. Authenticate and create the ... | github_jupyter |
```
import pandas as pd
import numpy as np
import zucaml.zucaml as ml
import matplotlib.pyplot as plt
%matplotlib inline
pd.set_option('display.max_columns', None)
```
#### gold
```
df_gold = ml.get_csv('data/gold/', 'gold', [])
df_gold = df_gold.sort_values(['date', 'x', 'y', 'z'], ascending = [True, True, True,... | github_jupyter |
<a href="https://colab.research.google.com/github/LambdaTheda/DS-Unit-2-Linear-Models/blob/master/10_45p_Copy_of_latest_sun_mar_01_unit_2_sprint_3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
_Lambda School Data Science, Unit 2_
# Applied Modeli... | github_jupyter |
```
#format the book
%matplotlib inline
from __future__ import division, print_function
import sys
sys.path.insert(0, '..')
import book_format
book_format.set_style()
```
# Converting the Multivariate Equations to the Univariate Case
The multivariate Kalman filter equations do not resemble the equations for the univa... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib import cm
from matplotlib import rc
import os, sys
import astropy.constants as const
import astropy.units as u
from astropy.cosmology import z_at_value
from astropy.cosmology imp... | github_jupyter |
```
import glob, sys
from IPython.display import HTML
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from astropy.io import fits
from pyflowmaps.flow import flowLCT
import warnings
warnings.filterwarnings("ignore")
```
# Load the data
We include in the folder *data/* a c... | github_jupyter |
# Loops
Loops is a basic statement in any programming language. Python supports the two typical loops:
- for --> Loops in a pre-defined number of iterations
- while --> Loops until a condition is reached
# For
```
# For
for i in range(1, 20):
print(i)
# iterates a list to retrieve data
my_list = [1, 2, 2, 4, ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# TODO Read in weight_loss.csv
# Assign variables to columns
mean_group_a = np.mean(weight_lost_a)
mean_group_b = np.mean(weight_lost_b)
plt.hist(weight_lost_a)
plt.show()
plt.hist(weight_lost_b)
plt.show()
mean_difference = mean_group_b - me... | github_jupyter |
# Assignment 09 Solutions
#### 1. YouTube offers different playback speed options for users. This allows users to increase or decrease the speed of the video content. Given the actual duration and playback speed of the video, calculate the playback duration of the video.
**Examples:**
`playback_duration("00:30:00"... | github_jupyter |

# Functions & Modules
### You can access this notebook on:
[colab](https://colab.com/py/), [github](https://github.com/chisomloius/iLearnPy/), [kaggle](https://kaggle.com/chisomloius/ilearnPy/), [medium](https://medium.com/@chisomloius/ilearnPy/), [web](https://chisomloius.github.io), [zin... | github_jupyter |
```
from config import *
from utils import *
import os
import sys
import copy
import numpy as np
import collections
import multiprocessing
import pickle
import numpy as np
import scipy
# Suppress pandas future warning, which messes tqdm
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
i... | github_jupyter |
# Practical Quantum Computing Approach for Sustainable Workflow Optimization in Cloud Infrastructures
by [Valter Uotila](https://researchportal.helsinki.fi/en/persons/valter-johan-edvard-uotila), PhD student, [Unified Database Management Systems](https://www2.helsinki.fi/en/researchgroups/unified-database-management-s... | github_jupyter |
## MatplotLib Tutorial
Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, wxPython, Qt, or GTK+.
Some of the major Pros of Matplotl... | github_jupyter |
```
import numpy as np
docs = ["I enjoy playing TT", "I like playing TT"]
docs[0][0].split()
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=0, token_pattern=r"\b\w+\b")
vectorizer.fit(docs)
print(vectorizer.vocabulary_)
# encode document
vector = vectorizer.transform(do... | github_jupyter |
# Lista de Exercรญcios 4
Mรฉtodos Numรฉricos para Engenharia - Turma C
Nome: Vinรญcius de Castro Cantuรกria
Matrรญcula: 14/0165169
Observaรงรตes:
0. A lista de exercรญcios deve ser entregue no moodle da disciplina.
0. A lista de exercรญcios deve ser respondida neste รบnico arquivo (.ipynb). Responda a cada questรฃo na cรฉl... | github_jupyter |
```
import numpy as np
from pyspark import SparkConf, SparkContext
from pyspark.sql import SparkSession
import time
import re
spark=SparkSession.builder\
.config("spark.debug.maxToStringFields", 100000)\
.config("spark.local.dir", '/home/osboxes/hw/hw3/')\
.appName("hw3")\
.getOrCreate()
sc=spark.sparkC... | github_jupyter |
# Video Super Resolution with OpenVINO
Super Resolution is the process of enhancing the quality of an image by increasing the pixel count using deep learning. This notebook applies Single Image Super Resolution (SISR) to frames in a 360p (480ร360) video in 360p resolution. We use a model called [single-image-super-reso... | github_jupyter |
**Reinforcement Learning with TensorFlow & TRFL: Q Learning**
* This notebook shows how to apply the classic Reinforcement Learning (RL) idea of Q learning with TRFL.
* In TD learning we estimated state values: V(s). In Q learning we estimate action values: Q(s,a). Here we'll go over Q learning in the simple tabular ca... | github_jupyter |
# Data Preparation and Advanced Model Evaluation
## Agenda
**Data preparation**
- Handling missing values
- Handling categorical features (review)
**Advanced model evaluation**
- ROC curves and AUC
- Bonus: ROC curve is only sensitive to rank order of predicted probabilities
- Cross-validation
## Part 1: Handling... | github_jupyter |
# Tensorboard example
```
import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
with open('anna.txt', 'r') as f:
text=f.read()
vocab = set(text)
vocab_to_int = {c: i for i, c in enumerate(vocab)}
int_to_vocab = dict(enumerate(vocab))
encoded = np.array([vocab_to_int[c] for c in ... | github_jupyter |
# The Python ecosystem - The pandas library
The [pandas library](https://pandas.pydata.org/) was created by [Wes McKinney](http://wesmckinney.com/) in 2010. pandas provides **data structures** and **functions**
for manipulating, processing, cleaning and crunching data. In the Python ecosystem pandas is the state-of-t... | github_jupyter |
# Run AwareDX ad-hoc on any drug and adverse event
```
from os import path
from collections import Counter, defaultdict
from tqdm.notebook import tqdm
import numpy as np
import pandas as pd
import feather
import scipy.stats
from scipy import stats
import pymysql
import pymysql.cursors
from database import Database
f... | github_jupyter |
**Notas para contenedor de docker:**
Comando de docker para ejecuciรณn de la nota de forma local:
nota: cambiar `dir_montar` por la ruta de directorio que se desea mapear a `/datos` dentro del contenedor de docker.
```
dir_montar=<ruta completa de mi mรกquina a mi directorio>#aquรญ colocar la ruta al directorio a monta... | github_jupyter |
```
import os
import findspark
findspark.find()
findspark.init(os.environ.get("SPARK_HOME"))
import sys
sys.path.append("/Users/minjungchoi/spark/spark-2.4.0-bin-hadoop2.7/python/pyspark")
from pyspark import SparkConf
from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql.types import... | github_jupyter |
```
import transformers
from transformers import BertModel, BertTokenizer, AdamW, get_linear_schedule_with_warmup
import torch
import gc
gc.collect()
torch.cuda.empty_cache()
import numpy as np
import pandas as pd
import seaborn as sns
from pylab import rcParams
import matplotlib.pyplot as plt
from matplotlib import rc... | github_jupyter |
# Importing libraries and utils
```
import utils
import pandas as pd
```
# Loading the data
```
offense, defense = utils.get_data("stats")
salary = utils.get_data("salary")
AFC, NFC = utils.get_data("wins")
```
# Verifying the data loaded correctly
```
offense[2]
defense[3]
salary
AFC[0]
NFC[2]
```
# Cleaning the... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/nishi1612/SC374-Computational-and-Numerical-Methods/blob/master/Set_3.ipynb)
Set 3
---
**Finding roots of polynomial by bisection method**
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
from google.colab import fi... | github_jupyter |
# PyTorch Introduction
This is an introduction of PyTorch. Itโs a Python-based scientific computing package targeted at two sets of audiences:
- A replacement for NumPy to use the power of GPUs;
- a deep learning research platform that provides maximum flexibility and speed.
- [`torch.Tensor`](https://pytorch.or... | github_jupyter |
## Regression with gradient-boosted trees and MLlib pipelines
This notebook uses a bike-sharing dataset to illustrate MLlib pipelines and the gradient-boosted trees machine learning algorithm. The challenge is to predict the number of bicycle rentals per hour based on the features available in the dataset such as day o... | github_jupyter |
# Compiling and running C programs
As in [the example](https://github.com/tweag/funflow/tree/v1.5.0/funflow-examples/compile-and-run-c-files) in funflow version 1, we can construct a `Flow` which compiles and executes a C program. As in the older versions of this example, we will use the `gcc` Docker image to run our ... | github_jupyter |
# Pivot
## Formato Wide y Formato Long
Dentro del mundo de los dataframe (o datos tabulares) existen dos formas de presentar la naturaleza de los datos: formato wide y formato long.
Por ejemplo, el conjunto de datos [Zoo Data Set](http://archive.ics.uci.edu/ml/datasets/zoo) presenta las caracterรญsticas de diversos a... | github_jupyter |
<a href="https://colab.research.google.com/github/cshah13/workforce-opportunities-baltimore-denver/blob/main/Shah_Baltimore_Denver_Job_Analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Import Libraries
```
# import libraries
# data analys... | github_jupyter |
## Basic Training
UC Berkeley Python Bootcamp
```
print("Hello, world.")
```
# Calculator #
> there are `int` and `float` (but not doubles)
```
print(2 + 2)
2 + 2
print(2.1 + 2)
2.1 + 2 == 4.0999999999999996
%run talktools
```
- Python stores floats as their byte representation so is limited by the same 16-bit p... | github_jupyter |
```
import pandas as pd
import numpy as np
def load_forces(forces):
df_streets = dict()
for force in forces:
file_path_streets = './Data/force_data/' + force + '_street.csv'
df_streets[force] = pd.read_csv(file_path_streets, low_memory=False, index_col=0)
return df_streets
```
... | github_jupyter |
# 1millionwomentotech SummerOfCode
## Intro to AI: Week 4 Day 3
```
print(baby_train[50000]['reviewText'])
from nltk.sentiment.vader import SentimentIntensityAnalyzer
sia = SentimentIntensityAnalyzer()
text = baby_train[50000]['reviewText']
for s in sent_tokenize(text):
print(s)
print(sia.polarity_scores(s))
... | github_jupyter |
# ่ชๅจๆฑๅฏผ็็ธๅ
ณ่ฎพ็ฝฎ
- Tensor็ๅฑๆง๏ผ
- requires_grad=True
- ๆฏๅฆ็จๆฅๆฑๅฏผ
- is_leaf๏ผ
- ๅถๅญ่็นๅฟ
้กปๆฏ่ฎก็ฎ็็ปๆ๏ผ
- ็จๆทๅๅปบ็Tensor็is_leaf=True๏ผๅฐฝ็ฎกrequires_grad=True๏ผไนis_leaf=True๏ผ๏ผ
- requires_grad=False็Tensor็is_leaf=True๏ผ
- grad_fn๏ผ
- ็จๆฅๆๅฎๆฑๅฏผๅฝๆฐ๏ผ
- grad
- ็จๆฅ่ฟๅๅฏผๆฐ๏ผ
- dtype
... | github_jupyter |
```
import numpy as np
import os
from PIL import Image
from sklearn.preprocessing import LabelBinarizer
import sys
import glob
import argparse
import matplotlib.pyplot as plt
import pickle as pkl
from keras.applications.inception_v3 import InceptionV3, preprocess_input, decode_predictions
from keras.models import Model... | github_jupyter |
##### Copyright 2020 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
%run ../Python_files/load_dicts.py
%run ../Python_files/util.py
#!/usr/bin/env python
__author__ = "Jing Zhang"
__email__ = "jingzbu@gmail.com"
__status__ = "Development"
from util import *
import numpy as np
from numpy.linalg import inv, matrix_rank
import json
# load logit_route_choice_probability_matrix
P = ... | github_jupyter |
<h2> Basics of Python: Lists </h2>
We review using Lists in Python here.
Please run each cell and check the results.
A list (or array) is a collection of objects (variables) separated by comma.
The order is important, and we can access each element in the list with its index starting from 0.
```
# here is a list... | github_jupyter |
# lab2 Logisitic Regression
```
%matplotlib inline
import numpy as np
import matplotlib
import pandas as pd
import matplotlib.pyplot as plt
import scipy.optimize as op
```
## 1. Load Data
```
data = pd.read_csv('ex2data1.txt')
X = np.array(data.iloc[:,0:2])
y = np.array(data.iloc[:,2])
print('X.shape = ' + str(X.sha... | github_jupyter |
```
import numpy as np
import pandas as pd
from pandas import Series
```
## Series
```
Series?
animals = ['tiger','shetta','monkey']
capitals = {
'Egypt' : 'Cairo',
'UK' : 'London',
'France' : 'Paris'
}
_series = Series([1,2,3,4,5])
_series
Series([1,2,3,4],index=['one','two','three','four'])
animals = Se... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from sklearn.decomposition import PCA
df = pd.read_csv("wat-all.csv")
df
dff = pd.DataFra... | github_jupyter |
# Inference
This notebook is dedicated to testing and visualizing results for both the wiki and podcast datasets
Note:
Apologies for the gratuitous warnings. Tensorflow is aware of these issues and has rectified them in later versions of TensorFlow. Unfortunately, they persist for version 1.13.
```
from src.SliceNet... | github_jupyter |
<a href="https://colab.research.google.com/github/naufalhisyam/TurbidityPrediction-thesis/blob/main/convert2png.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## **BATCH CONVERT FROM DNG TO PNG**
INITIALIZATION
```
from google.colab import drive
... | github_jupyter |
#Aula 01
```
import pandas as pd
url_dados = 'https://github.com/alura-cursos/imersaodados3/blob/main/dados/dados_experimentos.zip?raw=true'
dados = pd.read_csv(url_dados, compression = 'zip')
dados
dados.head()
dados.shape
dados['tratamento']
dados['tratamento'].unique()
dados['tempo'].unique()
dados['dose'].unique... | github_jupyter |
```
# This script should be revised to an object-oriented program, which defines TS extraction class, trajectories classfication class, etc.
import numpy as np
import sys
import os
import glob
import shutil
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
fro... | github_jupyter |
# "The Role of Wide Baseline Stereo in the Deep Learning World"
> "Short history of wide baseline stereo in computer vision"
- toc: false
- image: images/doll_wbs_300.png
- branch: master
- badges: true
- comments: true
- hide: false
- search_exclude: false
## Rise of Wide Multiple Baseline Stereo
The *wide multiple ... | github_jupyter |
```
##### Comparisons between different plots
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
plt.rcParams['figure.figsize'] = [20, 15]
df1 = pd.read_csv('1.txt', sep='\t')
df2 = pd.read_csv('3.txt', sep='\t')
# scale func to show x-axis in years
scale_x = 12
t... | github_jupyter |
# Plotting with [cartopy](https://scitools.org.uk/cartopy/docs/latest/)
From Cartopy website:
* Cartopy is a Python package designed for geospatial data processing in order to produce maps and other geospatial data analyses.
* Cartopy makes use of the powerful PROJ.4, NumPy and Shapely libraries and includes a progr... | github_jupyter |
# Initialization
Welcome to the first assignment of "Improving Deep Neural Networks".
Training your neural network requires specifying an initial value of the weights. A well chosen initialization method will help learning.
If you completed the previous course of this specialization, you probably followed our ins... | github_jupyter |
# Gazebo proxy
The Gazebo proxy is an implementation of interfaces with all services provided by the `gazebo_ros_pkgs`. It allows easy use and from of the simulation through Python.
It can be configured for different `ROS_MASTER_URI` and `GAZEBO_MASTER_URI` environment variables to access instances of Gazebo running... | github_jupyter |
```
import tensorflow as tf
import numpy as np
from copy import deepcopy
epoch = 20
batch_size = 64
size_layer = 64
dropout_rate = 0.5
n_hops = 2
class BaseDataLoader():
def __init__(self):
self.data = {
'size': None,
'val':{
'inputs': None,
'questions... | github_jupyter |
#### ้่ฟRNNไฝฟ็จimdbๆฐๆฎ้ๅฎๆๆ
ๆๅ็ฑปไปปๅก
```
from __future__ import absolute_import,print_function,division,unicode_literals
import tensorflow as tf
import tensorflow.keras as keras
import numpy as np
import os
tf.__version__
tf.random.set_seed(22)
np.random.seed(22)
os.environ['TF_CPP_LOG_LEVEL'] = '2'
# ่ถ
ๅๆฐ
vocab_size = 10000
m... | github_jupyter |
```
from google.colab import drive
#drive.flush_and_unmount()
drive.mount('/content/drive')
```
# 05 Bayesian Linear Regression for Student Grade Prediction
In this notebook, we will develop bayesian linear regression for student grade prediction. We will conduct EDA to analyze data, develop conventional linear regr... | github_jupyter |
# Bayes's Theorem
Think Bayes, Second Edition
Copyright 2020 Allen B. Downey
License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
# Get utils.py
import os
if not os.path.exists('utils.py'):
!wget https://github.com/AllenDow... | github_jupyter |
```
from plot_helpers import *
from source_files_extended import load_sfm_depth, load_aso_depth, load_classifier_data
figure_style= dict(figsize=(8, 6))
aso_snow_depth_values = load_aso_depth()
sfm_snow_depth_values = load_sfm_depth(aso_snow_depth_values.mask)
```
## SfM snow depth distribution
```
data = [
{
... | github_jupyter |
```
from torchvision.models import *
import wandb
from sklearn.model_selection import train_test_split
import os,cv2
import numpy as np
import matplotlib.pyplot as plt
from torch.optim import *
from torch.nn import *
import torch,torchvision
from tqdm import tqdm
device = 'cuda'
PROJECT_NAME = 'Fruit-Recognition'
def l... | github_jupyter |
# Quickstart
## Creating an isotherm
First, we need to import the package.
```
import pygaps
```
The backbone of the framework is the PointIsotherm class. This class stores the isotherm
data alongside isotherm properties such as the material, adsorbate and temperature, as well
as providing easy interaction with t... | github_jupyter |
# **Numba**
### Numba is a JIT Compiler and uses LLVM internally - No compilation required !

```
import time
def get_time_taken(func, *args):
res = func(*args)
start = time.time()
func(*args)
end = time.time()
time_taken = end - start
print(f"Total time - {time... | github_jupyter |
---
_You are currently looking at **version 1.3** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-machine-learning/resources/bANLa) course resource._
---
# Assignment 1 - I... | github_jupyter |
# Recommender Systems
### Reverse-engeneering users needs/desires
Recommender systems have been in the heart of ML. Mostly that in order to get insigths on large populations it was necessary to understand how users behave, but this can only be done from the historical behaviour.
Let's fix some setting that we use fo... | github_jupyter |
# 1. Import libraries
```
#----------------------------Reproducible----------------------------------------------------------------------------------------
import numpy as np
import random as rn
import os
seed=0
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
rn.seed(seed)
#---------------------------... | github_jupyter |
```
# biopy-isatab Python parser for ISA-tab
from bcbio import isatab
rec = isatab.parse(input_dir)
print(rec.metadata)
print('\n\n')
print(rec.ontology_refs)
print('\n\n')
print(rec.publications)
print('\n\n')
print(rec.studies)
# Import isa-files from Metabolights
# (connection with Metabolights is necessary)
from... | github_jupyter |
<img src="./pictures/DroneApp_logo.png" style="float:right; max-width: 180px; display: inline" alt="INSA" /></a>
<img src="./pictures/logo_sizinglab.png" style="float:right; max-width: 100px; display: inline" alt="INSA" /></a>
# Frame design
The objective of this study, is to optimize the overall design in terms of m... | github_jupyter |
<center> <img src="profitroll.png">
# <center><span style="font-size: 50px; color: blue;">PROFITROLL BACKUP DEMO</span></center>
<center><span style="font-size: 25px; color: purple;">This notebook is an advanced tutorial for users already familiar with <b><i>profitroll<i/></b> basic use. If you discover profiteroll, ... | github_jupyter |
# Customizing visual appearance
HoloViews elements like the `Scatter` points illustrated in the [Introduction](1-Introduction.ipynb) contain two types of information:
- **Your data**, in as close to its original form as possible, so that it can be analyzed and accessed as you see fit.
- **Metadata specifying what y... | github_jupyter |
# 2D Advection-Diffusion equation
in this notebook we provide a simple example of the DeepMoD algorithm and apply it on the 2D advection-diffusion equation.
```
# General imports
import numpy as np
import torch
# DeepMoD functions
from deepymod import DeepMoD
from deepymod.model.func_approx import NN
from deepymod.mo... | github_jupyter |
```
import torch
from torchvision import transforms
import torch.nn as nn
import torchvision.datasets as datasets
train_dataset = datasets.MNIST(root='../../data/',
train=True,
transform=transforms.ToTensor(),
download=True) ... | github_jupyter |
<a href="https://colab.research.google.com/github/cxbxmxcx/EatNoEat/blob/master/Chapter_9_EatNoEat_Training.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import tensorflow as tf
import numpy as np
import random
import matplotlib
import matplot... | github_jupyter |
## 1. Loading your friend's data into a dictionary
<p><img src="https://assets.datacamp.com/production/project_1237/img/netflix.jpg" alt="Someone's feet on table facing a television"></p>
<p>Netflix! What started in 1997 as a DVD rental service has since exploded into the largest entertainment/media company by <a href=... | github_jupyter |
<a href="https://www.nvidia.com/dli"> <img src="imgs/header.png" alt="Header" style="width: 400px;"/> </a>
<h1 align="center">์ธํ
๋ฆฌ์ ํธ ๋น๋์ค ๋ถ์์ ์ํ ๋ฅ๋ฌ๋</h1>
<h4 align="center">(1๋ถ)</h4>
<img src="imgs/intro.gif" alt="AFRL1" style="margin-top:50px"/>
<p style="text-align: center;color:gray"> ๊ทธ๋ฆผ 1. "vehicle" ํด๋์ค์ ๋ํ ์ค์๊ฐ ๊ฐ์ฒด... | github_jupyter |
```
%load_ext autoreload
%reload_ext autoreload
%autoreload 2
%matplotlib inline
import os
# TO USE A DATABASE OTHER THAN SQLITE, USE THIS LINE
# Note that this is necessary for parallel execution amongst other things...
# os.environ['SNORKELDB'] = 'postgres:///snorkel-intro'
from snorkel import SnorkelSession
sessi... | github_jupyter |
# Recurrent Neural Networks (RNN) with Keras
## Learning Objectives
1. Add built-in RNN layers.
2. Build bidirectional RNNs.
3. Using CuDNN kernels when available.
4. Build a RNN model with nested input/output.
## Introduction
Recurrent neural networks (RNN) are a class of neural networks that is powerful for
model... | github_jupyter |
# Hypothesis tests
In this notebook, we will be performing hypothesis tests to valiate certain speculations.
```
# Load the required packages
import json
import pandas as pd
import plotly.express as px
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import ttest_ind, chi2_contingency
import plo... | github_jupyter |
# Pretrained GPT2 Model Deployment Example
In this notebook, we will run an example of text generation using GPT2 model exported from HuggingFace and deployed with Seldon's Triton pre-packed server. the example also covers converting the model to ONNX format.
The implemented example below is of the Greedy approach f... | github_jupyter |
# Naive forecasting
## Setup
```
import numpy as np
import matplotlib.pyplot as plt
def plot_series(time, series, format="-", start=0, end=None, label=None):
plt.plot(time[start:end], series[start:end], format, label=label)
plt.xlabel("Time")
plt.ylabel("Value")
if label:
plt.legend(fontsize=1... | github_jupyter |
# Working model
**Version 13a**:
- Word level tokens
- GRU type RNNs
- 'sparse_categorical_crossentropy' to save memory
- dropout to hinder overfitting
**Conclusions:**
- 'sparse' works!
- 'sparse' runs 6x faster, strange, perhaps less work on fewer data?
- testing 'dropout', works soso
- 'so so' translation, perfect ... | github_jupyter |
##### Copyright 2020 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
import covid
from datetime import datetime,timedelta, date
from IPython.display import clear_output
from IPython.display import Markdown
import ipywidgets as widgets
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import plotly.io as pio
import pandas as pd
%%... | github_jupyter |
```
import numpy as np
# Zadanie 1
np.random.seed(123)
x = np.random.uniform(-4, 4, 30)
x
(x>=0).sum()
np.sum(x>=0)
x_abs = np.abs(x)
x_abs.mean()
x.min()
x.max()
x_abs.max()
x[x_abs.argmax()]
x[x_abs.argmin()]
x[np.argmax(x_abs)]
odleglosc = np.abs(x-0)
np.argmin(odleglosc)
x[np.argmin(odleglosc)]
x[np.argmin(np.abs(... | github_jupyter |
```
import os
import torch
from torch import nn
import torchtext
import torchtext.vocab as Vocab
import torch.utils.data as Data
import torch.nn.functional as F
import sys
sys.path.append("..")
# import d2lzh_pytorch as d2l
# os.environ["CUDA_VISIBLE_DEVICES"] = "0"
device = torch.device('cuda' if torch.cuda.is_ava... | github_jupyter |
Copyright 2020 Andrew M. Olney and made available under [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0) for text and [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) for code.
# Gradient boosting: Problem solving
This session will use a dataset of video game sales for games that sold at least 100,0... | github_jupyter |
**[Intermediate Machine Learning Home Page](https://www.kaggle.com/learn/intermediate-machine-learning)**
---
In this exercise, you will use **pipelines** to improve the efficiency of your machine learning code.
# Setup
The questions below will give you feedback on your work. Run the following cell to set up the fe... | github_jupyter |
# Paging Algorithms Visualization
```
import matplotlib.pyplot as plt
```
## FIFO
```
# Number of page frames
pf = 3
reference_string = [1,3,0,3,5,6,3]
def calculate_page_hits(rf_string,page_frames):
page = []
hits = 0
for el in rf_string:
if len(page) < page_frames:
hits = hits+1
... | github_jupyter |
```
import pandas as pd
import numpy as np
import altair as alt
df = pd.read_csv("data/train.csv")
df.head()
df.info()
numeric_features_eda = [
"floor_area",
"year_built",
"energy_star_rating",
"ELEVATION",
"january_min_temp",
"january_avg_temp",
"january_max_temp",
"february_min_temp",... | github_jupyter |
```
import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
from matplotlib.pyplot import figure
```
# Onset of symptoms to death
```
df = pd.read_csv('/Users/julianeoliveira/Desktop/github/PAMEpi-Reproducibility-of-published-results/RISK FACTORS AND DISEASE PROFILE OF SARS-COV-2 INFECTIONS IN BRA... | github_jupyter |
### Importante:
El primer paso para poder responder a la pregunta:
ยฟCuรกnto de buenos son los resultados de las mรฉtricas de tu modelo? (mae,rmse,...)
Necesitas tener unas mรฉtricas con las que poder compararlas. Para ello, debes entrenar el modelo mรกs sencillo (regresiรณn/clasificaciรณn) para poder hacerlo. Este modelo ... | github_jupyter |
<a href="https://colab.research.google.com/github/claytonchagas/intpy_prod/blob/main/9_4_automatic_evaluation_dataone_Digital_RADs_ast_only_files.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!sudo apt-get update
!sudo apt-get install python3.... | github_jupyter |
import libs
```
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data process... | github_jupyter |
# Calculate the rotation distribution for hot stars
```
import numpy as np
import matplotlib.pyplot as plt
from plotstuff import colours
cols = colours()
%matplotlib inline
plotpar = {'axes.labelsize': 20,
'text.fontsize': 20,
'legend.fontsize': 15,
'xtick.labelsize': 20,
'y... | github_jupyter |
# Implementing logistic regression from scratch
The goal of this notebook is to implement your own logistic regression classifier. You will:
* Extract features from Amazon product reviews.
* Convert an SFrame into a NumPy array.
* Implement the link function for logistic regression.
* Write a function to compute ... | github_jupyter |
# Project: Exploring and Analysing European Football
## Table of Contents
<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#wrangling">Data Wrangling</a></li>
<li><a href="#eda">Exploratory Data Analysis</a></li>
<li><a href="#conclusions">Conclusions</a></li>
</ul>
<a id='intro'></a>
## Introduction
> ... | github_jupyter |
<a href="https://colab.research.google.com/github/ghost331/Recurrent-Neural-Network/blob/main/Covid_19_Analysis_using_RNN_with_LSTM.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#Data: https://github.com/CSSEGISandData/COVID-19/blob/master/css... | github_jupyter |
### Installation
```
pip install -q tensorflow tensorflow-datasets
```
#### Imports
```
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
from tensorflow import keras
import tensorflow_datasets as tfds
```
### Checking datasets
```
print(tfds.list_builders())
```
### Getting data Infomati... | github_jupyter |
<table width="100%"> <tr>
<td style="background-color:#ffffff;">
<a href="https://qsoftware.lu.lv/index.php/qworld/" target="_blank"><img src="../images/qworld.jpg" width="35%" align="left"> </a></td>
<td style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
... | github_jupyter |
### Test spatial distribution of molecular clusters:
1) to determine the spatiall distribution of molecular cell types (a.k.a. whether they are clustered, dispersed or uniformly distributed), we compared the cell types with a CSR (complete spatial randomness) process and performed a monte carlo test of CSR (Cressie; ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.