text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
##### Copyright 2019 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 libraries
import sklearn
from sklearn import model_selection
import numpy as np
np.random.seed(42)
import os
import pandas as pd
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
# Ignore useless warnings (see SciPy issue #5998)
import warnings
warnings.filterwarnings(action... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns; sns.set()
trips = pd.read_csv('2015_trip_data.csv',
parse_dates=['starttime', 'stoptime'],
infer_datetime_format=True)
ind = pd.DatetimeIndex(trips.starttime)
trip... | github_jupyter |
# T81-558: Applications of Deep Neural Networks
**Module 13: Advanced/Other Topics**
* Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), McKelvey School of Engineering, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx)
* For more information visit the [class w... | github_jupyter |
```
%%html
<style>
body {
font-family: "Cambria", cursive, sans-serif;
}
</style>
import random, time
import numpy as np
from collections import defaultdict
import operator
import matplotlib.pyplot as plt
```
## Misc functions and utilities
```
orientations = EAST, NORTH, WEST, SOUTH = [(1, 0), (0, 1), (-1, 0), (... | github_jupyter |
```
library('magrittr')
library('dplyr')
library('tidyr')
library('readr')
library('ggplot2')
flow_data <-
read_tsv(
'data.tsv',
col_types=cols(
`Donor`=col_factor(levels=c('Donor 25', 'Donor 34', 'Donor 35', 'Donor 40', 'Donor 41')),
`Condition`=col_factor(levels=c('No elect... | github_jupyter |
# Proyecto
## Instrucciones
1.- Completa los datos personales (nombre y rol USM) de cada integrante en siguiente celda.
* __Nombre-Rol__:
* Cristobal Salazar 201669515-k
* Andres Riveros 201710505-4
* Matias Sasso 201704523-k
* Javier Valladares 201710508-9
2.- Debes _pushear_ este archivo con tus cambios a tu... | github_jupyter |
##### Copyright 2018 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 |
### An Auto correct system is an application that changes mispelled words into the correct ones.
```
# In this notebook I'll show how to implement an Auto Correct System that its very usefull.
# This auto correct system only search for spelling erros, not contextual errors.
```
*The implementation can be divided in... | github_jupyter |
## Birthday Paradox
In a group of 5 people, how likely is it that everyone has a unique birthday (assuming that nobody was born on February 29th of a leap year)? You may feel it is highly likely because there are $365$ days in a year and loosely speaking, $365$ is "much greater" than $5$. Indeed, as you shall see, thi... | github_jupyter |
# Train a basic TensorFlow Lite for Microcontrollers model
This notebook demonstrates the process of training a 2.5 kB model using TensorFlow and converting it for use with TensorFlow Lite for Microcontrollers.
Deep learning networks learn to model patterns in underlying data. Here, we're going to train a network to... | github_jupyter |
## Conceptual description
As people interact, they tend to become more alike in their beliefs, attitudes and behaviour. In "The Dissemination of Culture: A Model with Local Convergence and Global Polarization" (1997), Robert Axelrod presents an agent-based model to explain cultural diffusion. Analogous to Schelling's ... | github_jupyter |
## Imports
```
import numpy as np
import matplotlib.pyplot as plt
%tensorflow_version 2.x
import tensorflow as tf
from tensorflow import keras
from keras.models import Sequential, Model
from keras.layers import Flatten, Dense, LSTM, GRU, SimpleRNN, RepeatVector, Input
from keras import backend as K
from keras.utils.vi... | github_jupyter |
# HRF downsampling
This short notebook is why (often) we have to downsample our predictors after convolution with an HRF.
```
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from nistats.hemodynamic_models import glover_hrf
%matplotlib inline
```
First, let's define our data. Suppose we did a... | github_jupyter |
# Table of Contents
<p><div class="lev1 toc-item"><a href="#Linear-Regression-problem" data-toc-modified-id="Linear-Regression-problem-1"><span class="toc-item-num">1 </span>Linear Regression problem</a></div><div class="lev1 toc-item"><a href="#Gradient-Descent" data-toc-modified-id="Gradient-Descent-2"><s... | github_jupyter |
```
import cv2
import numpy as np
import pandas as pd
import numba
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import matplotlib
model = 'neural'
symmetric = False
nPosts = 3
if symmetric == True:
data = 'SPP/symmetric_n' if model == 'collective' else 'NN/symmetric_n'
prefix = 'coll_s... | github_jupyter |
<h1 align="center"> TUGAS BESAR TF3101 - DINAMIKA SISTEM DAN SIMULASI </h1>
<h2 align="center"> Sistem Elektrik, Elektromekanik, dan Mekanik</h2>
<h3>Nama Anggota:</h3>
<body>
<ul>
<li>Erlant Muhammad Khalfani (13317025)</li>
<li>Bernardus Rendy (13317041)</li>
</ul>
</body>
## 1. Pemodelan Si... | github_jupyter |
# Game Music dataset: data cleaning and exploration
The goal with this notebook is cleaning the dataset to make it usable as well as providing a descriptive analysis of the dataset features.
## Data loading and cleaning
```
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
from ... | github_jupyter |
# Convolutional Neural Network in Keras
Bulding a Convolutional Neural Network to classify Fashion-MNIST.
#### Set seed for reproducibility
```
import numpy as np
np.random.seed(42)
```
#### Load dependencies
```
import os
from tensorflow.keras.datasets import fashion_mnist
from tensorflow.keras.models import Seq... | github_jupyter |
# Parallel GST using MPI
The purpose of this tutorial is to demonstrate how to compute GST estimates in parallel (using multiple CPUs or "processors"). The core PyGSTi computational routines are written to take advantage of multiple processors via the MPI communication framework, and so one must have a version of MPI ... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

# Automated Ma... | github_jupyter |
```
import numpy as np # type: ignore
import onnx
import onnx.helper as h
import onnx.checker as checker
from onnx import TensorProto as tp
from onnx import save
import onnxruntime
# Builds a pipeline that resizes and crops an input.
def build_preprocessing_model(filename):
nodes = []
nodes.append(
... | github_jupyter |
# Getting Started with BentoML
[BentoML](http://bentoml.ai) is an open-source framework for machine learning **model serving**, aiming to **bridge the gap between Data Science and DevOps**.
Data Scientists can easily package their models trained with any ML framework using BentoMl and reproduce the model for serving ... | github_jupyter |
# Time Complexity Examples
```
def logarithmic_problem(N):
i = N
while i > 1:
# do something
i = i // 2 # move on
%time logarithmic_problem(10000)
def linear_problem(N):
i = N
while i > 1:
# do something
i = i - 1 # move on
%time linear_problem(10000)
def... | github_jupyter |
# Differentially Private Covariance
SmartNoise offers three different functionalities within its `covariance` function:
1. Covariance between two vectors
2. Covariance matrix of a matrix
3. Cross-covariance matrix of a pair of matrices, where element $(i,j)$ of the returned matrix is the covariance of column $i$ of t... | github_jupyter |
<a href="https://colab.research.google.com/github/mashyko/object_detection/blob/master/Model_Quickload.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Tutorials Installation:
https://caffe2.ai/docs/tutorials.html
First download the tutorials sourc... | github_jupyter |
<table border="0">
<tr>
<td>
<img src="https://ictd2016.files.wordpress.com/2016/04/microsoft-research-logo-copy.jpg" style="width 30px;" />
</td>
<td>
<img src="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/MSR-ALICE-HeaderGraphic-1920x720_... | github_jupyter |
```
# default_exp models.cox
```
# Cox Proportional Hazard
> SA with features apart from time
We model the the instantaneous hazard as the product of two functions, one with the time component, and the other with the feature component.
$$
\begin{aligned}
\lambda(t,x) = \lambda(t)h(x)
\end{aligned}
$$
It is important... | github_jupyter |
(*** hide ***)
```
#nowarn "211"
open System
let airQuality = __SOURCE_DIRECTORY__ + "/data/airquality.csv"
```
(**
Interoperating between R and Deedle
===================================
The [R type provider](http://fslab.org/RProvider/) enables
smooth interoperation between R and F#. The type provider automatica... | github_jupyter |
```
from gs_quant.session import GsSession, Environment
from gs_quant.instrument import IRSwap
from gs_quant.risk import IRFwdRate, CarryScenario
from gs_quant.markets.portfolio import Portfolio
from gs_quant.markets import PricingContext
from datetime import datetime
import matplotlib.pylab as plt
import pandas as pd
... | github_jupyter |
>This notebook is part of our [Introduction to Machine Learning](http://www.codeheroku.com/course?course_id=1) course at [Code Heroku](http://www.codeheroku.com/).
Hey folks, today we are going to discuss about the application of gradient descent algorithm for solving machine learning problems. Let’s take a brief over... | github_jupyter |
```
import csv
import itertools
import operator
import numpy as np
import nltk
import sys
from datetime import datetime
from utils import *
import matplotlib.pyplot as plt
%matplotlib inline
vocabulary_size = 200
sentence_start_token = "START"
sentence_end_token = "END"
f = open('data/ratings_train.txt', 'r')
lines = ... | github_jupyter |
**Chapter 10 – Introduction to Artificial Neural Networks with Keras**
_This notebook contains all the sample code and solutions to the exercises in chapter 10._
# Setup
First, let's import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save the figures. We also check that Pyt... | github_jupyter |
Copyright 2021 DeepMind Technologies Limited
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 agreed to in writi... | github_jupyter |
# CRRT Mortality Prediction
## Model Construction
### Christopher V. Cosgriff, David Sasson, Colby Wilkinson, Kanhua Yin
The purpose of this notebook is to build a deep learning model that predicts ICU mortality in the CRRT population. The data is extracted in the `extract_cohort_and_features` notebook and stored in ... | github_jupyter |
```
# Mount Google Drive
from google.colab import drive # import drive from google colab
ROOT = "/content/drive" # default location for the drive
print(ROOT) # print content of ROOT (Optional)
drive.mount(ROOT) # we mount the google drive at /content/drive
!pip install pennylane
from I... | github_jupyter |
```
import pandas as pd
import numpy as np
import stellargraph as sg
from stellargraph.mapper import PaddedGraphGenerator
from stellargraph.layer import DeepGraphCNN
from stellargraph import StellarGraph
from stellargraph import datasets
from sklearn import model_selection
from IPython.display import display, HTML
... | github_jupyter |
# $H(curl, \Omega)$ Elliptic Problems
$\newcommand{\dd}{\,{\rm d}}$
$\newcommand{\uu}{\mathbf{u}}$
$\newcommand{\vv}{\mathbf{v}}$
$\newcommand{\nn}{\mathbf{n}}$
$\newcommand{\ff}{\mathbf{f}}$
$\newcommand{\Hcurlzero}{\mathbf{H}_0(\mbox{curl}, \Omega)}$
$\newcommand{\Curl}{\nabla \times}$
Let $\Omega \subset \mathbb{R... | github_jupyter |
# Emotion recognition using Emo-DB dataset and scikit-learn
### Database: Emo-DB database (free) 7 emotions
The data can be downloaded from http://emodb.bilderbar.info/index-1024.html
Code of emotions
W->Anger->Wut
L->Boredom->Langeweile
E->Disgust->Ekel
A->Anxiety/Fear->Angst
F->Happiness->Freude
T->Sadness->T... | github_jupyter |
# 07 - Ensemble Methods
by [Alejandro Correa Bahnsen](http://www.albahnsen.com/) & [Iván Torroledo](http://www.ivantorroledo.com/)
version 1.3, June 2018
## Part of the class [Applied Deep Learning](https://github.com/albahnsen/AppliedDeepLearningClass)
This notebook is licensed under a [Creative Commons Attributi... | github_jupyter |
```
import os
for dirname, _, filenames in os.walk('../input/covid19-image-dataset'):
for filename in filenames:
print(os.path.join(dirname, filename))
import tensorflow as tf
import numpy as np
import os
from matplotlib import pyplot as plt
import cv2
from tensorflow import keras
from keras.models import ... | github_jupyter |
# Collaborative filtering on Google Analytics data
This notebook demonstrates how to implement a WALS matrix refactorization approach to do collaborative filtering.
```
import os
PROJECT = "cloud-training-demos" # REPLACE WITH YOUR PROJECT ID
BUCKET = "cloud-training-demos-ml" # REPLACE WITH YOUR BUCKET NAME
REGION =... | github_jupyter |
# How to make the perfect time-lapse of the Earth
This tutorial shows a detail coverage of making time-lapse animations from satellite imagery like a pro.
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#0.-Prerequisites" data-toc-modified-id="0.-Prere... | github_jupyter |
##### 训练PNet
```
#导入公共文件
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
from torch.autograd import Variable
import sys
sys.path.append('../')
# add other package
import numpy as np
import pandas a... | github_jupyter |
```
# 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
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... | github_jupyter |
```
import math
import json
import pandas as pd
import numpy as np
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
#make test data set to sanity check
outgroup_test = ['ATGGAGATT']
test_seqs = ['ATGGAGATT', '... | github_jupyter |
```
%matplotlib inline
```
# Wasserstein 1D with PyTorch
In this small example, we consider the following minization problem:
\begin{align}\mu^* = \min_\mu W(\mu,\nu)\end{align}
where $\nu$ is a reference 1D measure. The problem is handled
by a projected gradient descent method, where the gradient is computed
by p... | github_jupyter |
```
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import numpy as np; np.random.seed(0)
import seaborn as sns
data = pd.read_csv("avocado.csv")
pd.set_option('display.max_rows', 100)
print(data)
data.head()
data.tail()
#BoxPlot_Avocado
columna_1 = data["Small Bags"]
columna_2 = data["Large Bag... | github_jupyter |
Центр непрерывного образования
# Программа «Python для автоматизации и анализа данных»
Неделя 3 - 1
*Ян Пиле, НИУ ВШЭ*
# Цикл for. Применение циклов к строкам, спискам, кортежам и словарям.
Циклы мы используем в тех случаях, когда нужно повторить что-нибудь n-ное количество раз. Например, у нас уже был цикл **Wh... | github_jupyter |
```
import numpy as np
import pandas as pd
import linearsolve as ls
import matplotlib.pyplot as plt
plt.style.use('classic')
%matplotlib inline
```
# Class 14: Prescott's Real Business Cycle Model I
In this notebook, we'll consider a centralized version of the model from pages 11-17 in Edward Prescott's article "Theo... | github_jupyter |
# The thermodynamics of ideal solutions
*Authors: Enze Chen (University of California, Berkeley)*
This animation will show how the Gibbs free energy curves correspond to a lens phase diagram.
## Python imports
```
# General libraries
import io
import os
# Scientific computing libraries
import numpy as np
from scip... | github_jupyter |
#### Copyright 2019 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 a... | github_jupyter |
# Caching
Interacting with files on a cloud provider can mean a lot of waiting on files downloading and uploading. `cloudpathlib` provides seamless on-demand caching of cloud content that can be persistent across processes and sessions to make sure you only download or upload when you need to.
## Are we synced?
Befo... | github_jupyter |
```
#Modified version of the following script from nilearn:
#https://nilearn.github.io/auto_examples/03_connectivity/plot_group_level_connectivity.html
from nilearn import datasets
from tqdm.notebook import tqdm
abide_dataset = datasets.fetch_abide_pcp(n_subjects=200)
abide_dataset.keys()
from nilearn import input_da... | github_jupyter |
<center>
<h1>Fetal Health Classification</h1>
<img src="https://blog.pregistry.com/wp-content/uploads/2018/08/AdobeStock_90496738.jpeg">
<small>Source: Google</small>
</center>
<p>
Fetal mortality refers to stillbirths or fetal death. It encompasses any death of a fetus after 20 weeks of gestation.
... | github_jupyter |
# HHVM
## 背景介绍
HHVM 是 Facebook (现 Meta) 开发的高性能 PHP 虚拟机,宣称达到了官方解释器的 9x 性能
### 为什么会有 HHVM
#### 脚本语言
##### Pros
一般我们使用脚本语言 (Perl,Python,PHP,JavaScript)是为了以下几个目的
1. 大部分的脚本语言都拥有较为完备的外部库,能够帮助开发者快速的开发/测试
- 使用 Python 作为 ebt 的技术栈也是因为 `numpy`, `pandas` 等数据科学库的支持比别的编程语言更加的完备
2. 动态语言的特性使得开发过程变得异常轻松,可以最大程度的实现可复用性和多态性,打个... | github_jupyter |
# Módulo 2: Scraping con Selenium
## LATAM Airlines
<a href="https://www.latam.com/es_ar/"><img src="https://i.pinimg.com/originals/dd/52/74/dd5274702d1382d696caeb6e0f6980c5.png" width="420"></img></a>
<br>
Vamos a scrapear el sitio de Latam para averiguar datos de vuelos en funcion el origen y destino, fecha y cabin... | github_jupyter |
# Accessing higher energy states with Qiskit Pulse
In most quantum algorithms/applications, computations are carried out over a 2-dimensional space spanned by $|0\rangle$ and $|1\rangle$. In IBM's hardware, however, there also exist higher energy states which are not typically used. The focus of this section is to exp... | github_jupyter |
# Exploratory Data Analysis Using Python and BigQuery
## Learning Objectives
1. Analyze a Pandas Dataframe
2. Create Seaborn plots for Exploratory Data Analysis in Python
3. Write a SQL query to pick up specific fields from a BigQuery dataset
4. Exploratory Analysis in BigQuery
## Introduction
This lab is an in... | github_jupyter |
In this notebook, we'll learn how to use GANs to do semi-supervised learning.
In supervised learning, we have a training set of inputs $x$ and class labels $y$. We train a model that takes $x$ as input and gives $y$ as output.
In semi-supervised learning, our goal is still to train a model that takes $x$ as input and... | github_jupyter |
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
from mlxtend.frequent_patterns import apriori, association_rules
from collections import Counter
# dataset = pd.read_csv("data.csv",encoding= 'unicode_escape')
dataset = pd.read_excel("Online Retail.xlsx")
dataset.head()
da... | github_jupyter |
```
import sys
import pickle
import numpy as np
import tensorflow as tf
import PIL.Image
%matplotlib inline
import matplotlib.pyplot as plt
```
##### Set the path to directory containing code of this case
```
new_path = r'/home/users/suihong/3-Cond_wellfacies-upload/'
sys.path.append(new_path)
```
#### Set the path ... | github_jupyter |
# Gaussian feedforward -- analysis
Ro Jefferson<br>
Last updated 2021-05-26
This is the companion notebook to "Gaussian_Feedforward.ipynb", and is designed to read and perform analysis on data generated by that notebook and stored in HDF5 format.
**The user must specify** the `PATH_TO_DATA` (where the HDF5 files to b... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
 # print content of ROOT (Optional)
drive.mount(ROOT) # we mount the google drive at /content/drive
!pip install pennylane
from I... | github_jupyter |
## Dependencies
```
# !pip install --quiet efficientnet
!pip install --quiet image-classifiers
import warnings, json, re, glob, math
from scripts_step_lr_schedulers import *
from melanoma_utility_scripts import *
from kaggle_datasets import KaggleDatasets
from sklearn.model_selection import KFold
import tensorflow.ker... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_07_1_gan_intro.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
**Module 7: Generative Advers... | github_jupyter |
# **Solving the Definition Extraction Problem**
### **Approach 3: Using Doc2Vec model and Classifiers.**
**Doc2Vec** is a Model that represents each Document as a Vector. The goal of Doc2Vec is to create a numeric representation of a document, regardless of its length. So, the input of texts per document can be vario... | github_jupyter |
```
from MPyDATA import ScalarField, VectorField, PeriodicBoundaryCondition, Options, Stepper, Solver
import numpy as np
dt, dx, dy = .1, .2, .3
nt, nx, ny = 100, 15, 10
# https://en.wikipedia.org/wiki/Arakawa_grids#Arakawa_C-grid
x, y = np.mgrid[
dx/2 : nx*dx : dx,
dy/2 : ny*dy : dy
]
# vector field (u,v) co... | github_jupyter |
# NLTK
## Sentence and Word Tokenization
```
from nltk.tokenize import sent_tokenize, word_tokenize
EXAMPLE_TEXT = "Hello Mr. Smith, how are you doing today? The weather is great, and Python is awesome. The sky is pinkish-blue. You shouldn't eat cardboard."
# Sentence Tokenization
print(sent_tokenize(EXAMPLE_TEXT))
#... | github_jupyter |
```
#@title blank template
#@markdown This notebook from [github.com/matteoferla/pyrosetta_help](https://github.com/matteoferla/pyrosetta_help).
#@markdown It can be opened in Colabs via [https://colab.research.google.com/github/matteoferla/pyrosetta_help/blob/main/colabs/colabs-pyrosetta.ipynb](https://colab.research... | github_jupyter |
```
import sqlite3
import pandas as pd
import numpy as np
import scipy as sp
import scipy.stats as stats
#import pylab as plt
import matplotlib.pyplot as plt
from collections import Counter
from numpy.random import choice
%matplotlib notebook
dbname = '../../data/sepsis.db'
conn = sqlite3.connect(dbname)
sql = 'SEL... | github_jupyter |
# 以下為 Export 成 freeze_graph 的範例程式嗎
```
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
from keras import backend as K
import tensorflow as tf
from tensorflow.python.tools import freeze_graph, optimize_for_inference_lib
import numpy as np
`... | github_jupyter |
# 1 - Installs and imports
```
!pip install --upgrade pip
!pip install sentencepiece
!pip install transformers
from transformers import AutoTokenizer, AutoModel, TFAutoModel, AutoConfig
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transf... | github_jupyter |
This notebook presents some code to compute some basic baselines.
In particular, it shows how to:
1. Use the provided validation set
2. Compute the top-30 metric
3. Save the predictions on the test in the right format for submission
```
%pylab inline --no-import-all
import os
from pathlib import Path
import pandas ... | github_jupyter |
# Preprocessing for deep learning
```
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('ggplot')
plt.rcParams['axes.facecolor'] ='w'
plt.rcParams['axes.edgecolor'] = '#D6D6D6'
plt.rcParams['axes.linewidth'] = 2
```
# 1. Background
## A. Variance and covariance
### Example 1.
`... | github_jupyter |
## Organização do dataset
```
def dicom2png(input_file, output_file):
try:
ds = pydicom.dcmread(input_file)
shape = ds.pixel_array.shape
# Convert to float to avoid overflow or underflow losses.
image_2d = ds.pixel_array.astype(float)
# Rescaling grey scale between 0-255
... | github_jupyter |
[](https://pythonista.io)
# Entrada y salida estándar.
En la actualidad existen muchas fuentes desde las que se puede obtener y desplegar la información que un sistema de cómputo consume, gestiona y genera. Sin embargo, para el intérprete de Python la salida por defecto (salida est... | github_jupyter |
```
# Take all JSON from Blob Container and upload to Azure Search
import globals
import os
import pickle
import json
import requests
from pprint import pprint
from azure.storage.blob import BlockBlobService
from joblib import Parallel, delayed
def processLocalFile(file_name):
json_content = {}
try:
... | github_jupyter |
# Schooling in Xenopus tadpoles: Power analysis
This is a supplementary notebook that generates some simulated data, and estimates the power analysis for a schooling protocol. The analysis subroutines are the same, or very close to ones from the actual notebook (**schooling_analysis**). The results of power analysis a... | github_jupyter |
# OCR (Optical Character Recognition) from Images with Transformers
---
[Github](https://github.com/eugenesiow/practical-ml/) | More Notebooks @ [eugenesiow/practical-ml](https://github.com/eugenesiow/practical-ml)
---
Notebook to recognise text automaticaly from an input image with either handwritten or printed te... | github_jupyter |
# 初始化
```
#@markdown - **挂载**
from google.colab import drive
drive.mount('GoogleDrive')
# #@markdown - **卸载**
# !fusermount -u GoogleDrive
```
# 代码区
```
#@title K-近邻算法 { display-mode: "both" }
# 该程序实现 k-NN 对三维随机数据的分类
#@markdown [参考程序](https://github.com/wzyonggege/statistical-learning-method/blob/master/KNearestNei... | github_jupyter |
# Implementing an LSTM RNN Model
------------------------
Here we implement an LSTM model on all a data set of Shakespeare works.
We start by loading the necessary libraries and resetting the default computational graph.
```
import os
import re
import string
import requests
import numpy as np
import collections
impor... | github_jupyter |
# Random Forest Classification
### Required Packages
```
import warnings
import numpy as np
import pandas as pd
import seaborn as se
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestC... | github_jupyter |
```
from __future__ import division
import numpy as np
from numpy import *
import os
import tensorflow as tf
import PIL
from PIL import Image
import matplotlib.pyplot as plt
from skimage import data, io, filters
from matplotlib.path import Path
import matplotlib.patches as patches
import pandas as pd
path_to_str... | github_jupyter |
# Project 3: Implement SLAM
---
## Project Overview
In this project, you'll implement SLAM for robot that moves and senses in a 2 dimensional, grid world!
SLAM gives us a way to both localize a robot and build up a map of its environment as a robot moves and senses in real-time. This is an active area of research... | github_jupyter |
# Apply CNN Classifier to DESI Spectra and visualize results with gradCAM
Mini-SV2 tiles from February-March 2020:
- https://desi.lbl.gov/trac/wiki/TargetSelectionWG/miniSV2
See also the DESI tile picker with (limited) SV0 tiles from March 2020:
- https://desi.lbl.gov/svn/data/tiles/trunk/
- https://desi.lbl.gov/svn/... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import os
import numpy as np, pandas as pd
import matplotlib.pyplot as plt, seaborn as sns
from tqdm import tqdm, tqdm_notebook
from pathlib import Path
# pd.set_option('display.max_columns', 1000)
# pd.set_option(... | github_jupyter |
# Codebuster STAT 535 Statistical Computing Project
## Movie recommendation recommendation pipeline
##### Patrick's comments 11/9
- Goal: Build a small real world deployment pipeline like it can be used in netflix / amazon
- build / test with movie recommendation data set (model fitting, data preprocessing, evaluati... | github_jupyter |
```
from glob import glob
from os import path
import re
from skbio import DistanceMatrix
import pandas as pd
import numpy as np
from kwipexpt import *
%matplotlib inline
%load_ext rpy2.ipython
%%R
library(tidyr)
library(dplyr, warn.conflicts=F, quietly=T)
library(ggplot2)
```
Calculate performance of kWIP
===========... | github_jupyter |
# Example from Image Processing
```
%matplotlib inline
import matplotlib.pyplot as plt
```
Here we'll take a look at a simple facial recognition example.
This uses a dataset available within scikit-learn consisting of a
subset of the [Labeled Faces in the Wild](http://vis-www.cs.umass.edu/lfw/)
data. Note that this ... | github_jupyter |
```
import pandas as pd #pandas does things with matrixes
import numpy as np #used for sorting a matrix
import matplotlib.pyplot as plt #matplotlib is used for plotting data
import matplotlib.ticker as ticker #used for changing tick spacing
import datetime as dt #used for dates
import matplotlib.dates as mdates #used ... | github_jupyter |
```
# 8.3.3. Natural Language Statistics
import random
import torch
from d2l import torch as d2l
tokens = d2l.tokenize(d2l.read_time_machine())
# Since each text line is not necessarily a sentence or a paragraph, we
# concatenate all text lines
corpus = [token for line in tokens for token in line]
vocab = d2l.Vocab(co... | github_jupyter |
## 7-3. HHLアルゴリズムを用いたポートフォリオ最適化
この節では論文[1]を参考に、過去の株価変動のデータから、最適なポートフォリオ(資産配分)を計算してみよう。
ポートフォリオ最適化は、[7-1節](7.1_quantum_phase_estimation_detailed.ipynb)で学んだHHLアルゴリズムを用いることで、従来より高速に解けることが期待されている問題の一つである。
今回は具体的に、GAFA (Google, Apple, Facebook, Amazon) の4社の株式に投資する際、どのような資産配分を行えば最も低いリスクで高いリターンを得られるかという問題を考える。
### 株価データ取得
まず... | github_jupyter |
# Create redo records
This Jupyter notebook shows how to create a Senzing "redo record".
It assumes a G2 database that is empty.
Essentially the steps are to create very similar records under different data sources,
then delete one of the records. This produces a "redo record".
## G2Engine
### Senzing initializati... | github_jupyter |
```
%matplotlib inline
```
Neural Transfer Using PyTorch
=============================
**Author**: `Alexis Jacq <https://alexis-jacq.github.io>`_
**Edited by**: `Winston Herring <https://github.com/winston6>`_
**Re-implemented by:** `Shubhajit Das <https://github.com/Shubhajitml>`
Introduction
------------
Th... | github_jupyter |
### Training a Graph Convolution Model
Now that we have the data appropriately formatted, we can use this data to train a Graph Convolution model. First we need to import the necessary libraries.
```
import deepchem as dc
from deepchem.models import GraphConvModel
import numpy as np
import sys
import pandas as pd
imp... | github_jupyter |
# Transmission
```
%matplotlib inline
import numpy as np
np.seterr(divide='ignore') # Ignore divide by zero in log plots
from scipy import signal
import scipy.signal
from numpy.fft import fft, fftfreq
import matplotlib.pyplot as plt
#import skrf as rf # pip install scikit-rf if you want to run this one
```
First, let... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.