text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
<a href="https://colab.research.google.com/github/dvschultz/stylegan3/blob/main/SG3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# StyleGAN3
By [Derrick Schultz](https://twitter.com/dvsch), with contributions from [crimeacs](https://twitter.com/... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/GetStarted/08_masking.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href="... | github_jupyter |
# Data Exploration
Learning objectives:
1. Learn useful patterns for exploring data before modeling
2. Gain an understanding of the dataset and identify any data issues.
The goal of this notebook is to explore our base tables before we began feature engineering and modeling. We will explore the price history of stoc... | github_jupyter |
# Automatic differentiation with JAX
## Main features
- Numpy wrapper
- Auto-vectorization
- Auto-parallelization (SPMD paradigm)
- Auto-differentiation
- XLA backend and JIT support
## How to compute gradient of your objective?
- Define it as a standard Python function
- Call ```jax.grad``` and voila!
- Do not for... | github_jupyter |
```
# Importing the required packages
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import warnings
warnings.filterwarnings('ignore')
import calendar
from tabulate import tabulate
%matplotlib inline
# Importing the requisite data
patients = pd.read_excel('Example_data.xlsx', sheet_name='p... | github_jupyter |
# Installation procedure
## Astroconda
It is encourage that users install AstroConda in order to have easy access to some of the dependecies required by the Pandeia engine. Please see the [AstroConda documentation](http://astroconda.readthedocs.io/en/latest/installation.html#install-astroconda) for instructions on se... | github_jupyter |
<h2 id='part1'>Project 1: Blog</h2>
Looking into the population of the stack Overflow data, I wanted to look at the differences between men and women.
__The questions that I want to answer are:__
<br> a) How big is the disparity in pay between men and women?
<br> b) How does having children impact progression?
<br> c... | github_jupyter |
[Look Up](https://www.luogu.org/problemnew/show/P2947)。给定一数组,求各数字右边第一个比该数字大的数,没有则设置0.
思路:单调栈的典型应用。从后往前扫描数组,设立一个栈,栈中始终保存比当前数字大的元素,若有小的全部弹出。
```
def LookUp(nums):
n = len(nums)
res = [0]*n
s = list()
for idx in range(n-1, -1, -1):
# 先排空栈中不大于当前数的所有数字
while s and nums[s[-1]] <= nums[idx]:... | github_jupyter |
# Loading important libraries
```
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Dense, Dropout, Activation, Input, Embeddi... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from common import *
RESULT_JSON = "/Users/law/repos/viper/results/breakdown/breakdown_revision.json"
from collections import defaultdict
runs = defaultdict(list)
BMS = get_all_runs(RESULT_JSON)
# pprint(BMS)
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)
TIM... | github_jupyter |
```
import warnings
warnings.filterwarnings("ignore")
import sys
import os
import tensorflow as tf
# sys.path.append("../libs")
sys.path.insert(1, '../')
from libs import input_data
from libs import models
from libs import trainer
from libs import freeze
flags=tf.app.flags
flags=tf.app.flags
#Important Directories
f... | github_jupyter |
```
import numpy as np
from scipy import linalg # Invoke with linalg
import scipy.linalg # invoke with scipy.linalg
```
### **Matrix Matrix Multiplications operator @**
* `A@B` is a binary operator on A, B where A, B are both 2d array (matrices). It's equivalent to invoking `A.matnul(B)`.
Mathematically, as... | github_jupyter |
# Sketch Classifier for "How Do Humans Sketch Objects?"
A sketch classifier using the dataset from the paper <a href='http://cybertron.cg.tu-berlin.de/eitz/projects/classifysketch/'>How Do Humans Sketch Objects?</a> where the authors collected 20,000 unique sketches evenly distributed over 250 object categories - we w... | github_jupyter |
# 1. Decision trees
# Introduction
- Decision Trees are a type of Supervised Machine Learning (that is you explain what the input is and what the corresponding output is in the training data) where the data is continuously split according to a certain parameter.
- The tree can be explained by two entities, namely de... | github_jupyter |
# Distributed Federated Learning using PySyft
```
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
import syft as sy
hook = sy.TorchHook(torch)
bob = sy.VirtualWorker(hook, id='bob')
ali... | github_jupyter |
```
import pandas as pd
import numpy as np
import scipy.stats
from scipy.integrate import quad
from scipy.optimize import minimize
from scipy.special import expit, logit
from scipy.stats import norm
```
# Dataset
```
df = pd.read_csv("bank-note/bank-note/train.csv", header=None)
d = df.to_numpy()
X = d[:,:-1]
Y = d[:... | github_jupyter |
# Exploratory
## EEGECoG
Data info EEG-ECoG Task
*Task design
The blindfolded monkey was seated in a primate chair and tied hand.
*Data Format
A. ECoG_n.mat
Data matrix: (Channel+trigger) x Time
Sampling rate: 1000Hz
Location of electrodes:see "Su_brain.png"
Filter:Ba... | github_jupyter |
```
import scanpy as sc
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
import seaborn as sns
from anndata import AnnData
import os
from os.path import join
import time
from gprofiler import GProfiler
# scTRS tools
import ... | github_jupyter |
# Churn Risk Score Prediction
### Link to the Dataset: [Churn Risk Rate](https://www.kaggle.com/imsparsh/churn-risk-rate-hackerearth-ml?select=train.csv)
### Importing Libraries
```
import pandas as pd
from sklearn import preprocessing
from sklearn import metrics
import seaborn as sns
from sklearn.model_selection ... | github_jupyter |
```
import os
import pandas as pd
import pandas_ta as ta
import plotly.graph_objects as go
import plotly.io as pio
import yfinance as yf
from datetime import date
from datetime import datetime
ticker = "BABA"
from_date = datetime(2020, 1, 1)
to_date = datetime.today()
interval = "1d"
ticker_csv = os.path.join(os.getcw... | github_jupyter |
# Quick and Dirty Diffusor Calibration
calibrates $gDT$ where $T$ is the tap point matrix, $D$ is the diffusor kernels (in this case, with no edges cut) and $g$ is the set of neuron gains.
This is meant to be used to drop into the existing numerical simulations of diffusor spread.
To make this more practical (workin... | 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 ... | github_jupyter |
### Clinical BCI Challenge-WCCI2020
- [website link](https://sites.google.com/view/bci-comp-wcci/?fbclid=IwAR37WLQ_xNd5qsZvktZCT8XJerHhmVb_bU5HDu69CnO85DE3iF0fs57vQ6M)
- [Dataset Link](https://github.com/5anirban9/Clinical-Brain-Computer-Interfaces-Challenge-WCCI-2020-Glasgow)
```
import mne
from scipy.io import lo... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(context = 'notebook', #mostly controls relative sizes of things on plot
#The base context is “notebook”, and the other contexts are “paper”, “talk”, and “poster”
style = 'darkgrid'... | github_jupyter |
```
'''
@ Author: Kai Song, ks838@cam.ac.uk
@ Notes: What does this small project do?
1. I used Recurrent Neural Network-LSTM to do text generating. I wrote the LSTM core part in
a relatively transparent way according Reference [1], indstead of using more
abstract/advanced ... | github_jupyter |
Lambda School Data Science
*Unit 4, Sprint 2, Module 4*
---
# Neural Network Frameworks (Prepare)
## Learning Objectives
* <a href="#p1">Part 1</a>: Implemenent Regularization Strategies
* <a href="#p2">Part 2</a>: Deploy a Keras Model
* <a href="#p3">Part 3</a>: Write a Custom Callback Function (Optional)
Today's... | github_jupyter |
# Inexact Move Function
Let's see how we can incorporate **uncertain** motion into our motion update. We include the `sense` function that you've seen, which updates an initial distribution based on whether a robot senses a grid color: red or green.
Next, you're tasked with modifying the `move` function so that it i... | 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 |
# Notebook contents:
This notebook contains a lecture. The code for generating plots are found at the of the notebook. Links below.
- [presentation](#Session-1b:)
- [code for plots](#Code-for-plots)
# Session 2:
## Effective ML
*Andreas Bjerre-Nielsen*
## Vaaaamos
```
import warnings
from sklearn.exceptions impo... | github_jupyter |
This is a quick writeup of where I'm at. There are still a lot of issues with the model I'll address below.
```
%matplotlib inline
%reload_ext autoreload
%autoreload 2
from fastai.structured import *
from fastai.column_data import *
np.set_printoptions(threshold=50, edgeitems=20)
PATH='data/credit_default_risk/'
app_t... | github_jupyter |
# Demonstration of using Curve registry
### Essential links:
* Source code: <https://github.com/curvefi/curve-pool-registry/tree/b17>;
* ABI: <https://github.com/curvefi/curve-pool-registry/blob/b17/deployed/2020-06-20/registry.abi>;
* Registry contract: `0x7002B727Ef8F5571Cb5F9D70D13DBEEb4dFAe9d1`.
### Complimentary... | github_jupyter |
## Git Stash
Before you can `git pull`, you need to have committed any changes you have made. If you find you want to pull, but you're not ready to commit, you have to temporarily "put aside" your uncommitted changes.
For this, you can use the `git stash` command, like in the following example:
```
import os
top_dir ... | github_jupyter |
In [The Mean as Predictor](mean_meaning), we found that the mean had some good
properties as a single best predictor for a whole distribution.
* The mean gives a total prediction error of zero. Put otherwise, on average,
your prediction error is zero.
* The mean gives the lowest squared error. Put otherwise, the m... | github_jupyter |
```
!cp drive/MyDrive/cornell-movie-dialog-turns.csv .
!ls -lah
```
# Load data
```
import pandas as pd
import torchtext
import torch
import time
import random
import math
from tqdm.notebook import tqdm
from torch import nn, optim
df = pd.read_csv('cornell-movie-dialog-turns.csv')
df.head(50_000).to_csv('cornell-mov... | github_jupyter |
```
import pandas as pd
import numpy as np
import datetime
from sklearn.preprocessing import LabelEncoder
```
# Loading processed data
Note: the file is big and hence will take some time to load
```
path = 'C:/Users/FT-LT74/hnm_fashion_recommendation/data/interim'
df = pd.read_csv(path+'/merged-df.csv')
df.head()
df... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
```
**References**
- https://arxiv.org/abs/1605.07723
- https://github.com/snorkel-team/snorkel-tutorials
- https://github.com/snorkel-team/snorkel-tutorials/blob/master/spam/01_spam_tutorial.ipynb
- https://medium.com/sculpt/a-technique-for-building-nlp-classifiers-efficiently-w... | github_jupyter |
<a href="https://colab.research.google.com/github/Ravio1i/ki-lab/blob/master/0_Simple_NN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Simple Neural Network with PyTorch. Original source can be found [here](https://pytorch.org/tutorials/beginner/p... | github_jupyter |
```
# import the mbd package
import pymbd as pymbd # python functions
import pymbd.lib as mbd # fortran functions
print(pymbd)
print(mbd)
import numpy as np
from itertools import chain
import matplotlib.pyplot as plt
%matplotlib inline
bohr = mbd.bohr
print(bohr)
# initialize the frequency grid to 20 points
mbd.init... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Pre_data = pd.read_csv("C:\\Users\\2019A00303\\Desktop\\Code\\Airbnb Project\\Data\\PreProcessingNetherlands.csv")
Pre_data
Pre_data['Price'].plot(kind='hist', bins=100)
Pre_data['group'] = pd.cut(x=Pre_data['Price'],
bins=[0, 50, 100, 150, 200... | github_jupyter |
# GPU-Accelerated Numerical Computing with MatX
## Tutorial List
1. [Introduction](01_introduction.ipynb)
2. [Operators](02_operators.ipynb)
3. Executors (this tutorial)
4. [Radar Pipeline Example](04_radar_pipeline.ipynb)
## Executors
MatX executors are a generic name given to functions that execute work on the devi... | github_jupyter |
\title{Combinational-Circuit Building Blocks aka medium scale integrated circuit (MSI) in myHDL}
\author{Steven K Armour}
\maketitle
# Table of Contents
<p><div class="lev1 toc-item"><a href="#Refs" data-toc-modified-id="Refs-1"><span class="toc-item-num">1 </span>Refs</a></div><div class="lev1 toc-item"><... | github_jupyter |
# GABLS stable ABL case
## Nalu-Wind 3.125m resolution, 1-eqn ksgs
Comparison with GABLS data
**Note**: To convert this notebook to PDF, use the command
```bash
$ jupyter nbconvert --TagRemovePreprocessor.remove_input_tags='{"hide_input"}' --to pdf postpro_gabls.ipynb
```
```
%%capture
# Important header information... | github_jupyter |
# Evaluation
```
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import warnings
warnings.filterwarnings('ignore')
plt.rcParams['figure.figsize'] = [10, 5]
```
# Continual Learning Metrics
```
# Because of a mistake in my implementation... | github_jupyter |
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
```
### Reading a file
- Each file here is a shard of hydi_track_10_58_0.trk (split into 10 shards). 72.7-165.3MB in size.
- Block size is 32MB
- 5 repetitions
#### 1 File sequential
```
df = pd.read_csv("../results/us-west-2-R5.4xlarge/se... | github_jupyter |
O [spaCy]("https://spacy.io") é uma bilbioteca Python de código fonte [aberto]("https://github.com/explosion/spaCy") para Processamento de
Linguagem Natural, constantemente a atualizada e mantida. Essa biblioteca é capaz de
processar diversas línguas, inclusive o português brasileiro.
### Instalação
No linux, a ins... | 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 ... | github_jupyter |
## 0.使用opencv展示图像
```
import cv2
def cv2_display(image_ndarray):
windowName = 'display'
cv2.imshow(windowName, image_ndarray)
# 按Esc键或者q键可以退出循环
pressKey = cv2.waitKey(0)
if 27 == pressKey or ord('q') == pressKey:
cv2.destroyAllWindows()
```
## 1.加载2张图片文件为图像数据
```
image_ndarray_1 = cv2.im... | github_jupyter |
```
import pandas as pd
import numpy as np
import sys, getopt
import matplotlib.pyplot as plt
import seaborn as sns
import copy
import numpy as np
from PIL import Image, ImageOps
import scanpy as sc
```
# Download input demo data
wget -O 10X_ST_demo.tar.gz https://zenodo.org/record/5524883/files/10X_ST_demo.tar.gz?dow... | github_jupyter |
## Preprocessing
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
np.random.seed(2)
x1 = pd.DataFrame(np.random.normal(size=50), columns=['col1'])
x2 = pd.DataFrame(np.random.normal(size=50), columns=['col2'])
x = pd.concat([x1, x2], axis=1)
x
x.col1.i... | github_jupyter |
```
%matplotlib nbagg
import os
import glob
from collections import defaultdict, namedtuple
import sqlite3
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import lsst.afw.table as afw_table
import lsst.daf.persistence as dp
import lsst.geom
import desc.sims_ci_pipe as scp
def make_SourceCatalog(d... | github_jupyter |
# Similar sounding words
This is a list of similar sounding words that I have collected from various sources on the web and added to as I find new pairs.
Unlike most homophone, homograph, and homonym resources this list is not targeting ESL or educational use. Instead it is designed for finding common errors in speec... | github_jupyter |
# Lesson 03: Transience and knickpoints
*This lesson has been written by Simon M. Mudd at the University of Edinburgh*
*Last update 30/09/2021*
Okay, if you have followed through the first two lessons, you will be getting a feel for the shape of channel longitudinal profiles. In this lesson, we will look at landscap... | github_jupyter |
# AWS Rekognition Text Detection Test
```
import boto3
s3_resource = boto3.resource('s3')
client=boto3.client('rekognition')
import matplotlib.pyplot as plt
%matplotlib inline
```
IMAGE 1
```
bucket='secondpythonbucket6ce9cccf-c429-471c-99a1-f36e849ee381'
photo='00007-4883-13_DB18ED97.jpg'
response=client.detect_te... | github_jupyter |
# Improving a model with Grid Search
In this mini-lab, we'll fit a decision tree model to some sample data. This initial model will overfit heavily. Then we'll use Grid Search to find better parameters for this model, to reduce the overfitting.
First, some imports.
```
%matplotlib inline
import pandas as pd
import n... | github_jupyter |
# 
```
# Generate illustrations of tessellation
This notebook contains one function `pipeline`, which for a given point (lat, lon) generates a sequence of seven images illustrating the process of creation of morphologicla tessellation within 250m buffer. The function is u... | github_jupyter |
# Magic Methods
Below you'll find the same code from the previous exercise except two more methods have been added: an __add__ method and a __repr__ method. Your task is to fill out the code and get all of the unit tests to pass. You'll find the code cell with the unit tests at the bottom of this Jupyter notebook.
As... | github_jupyter |
```
#input - log files from Open Eye Docking
#Does - computes the average score for each ligand from the 10 scores(1 score from each cluster structure) and then ranks tham
# Output - txt file with the ligands ranked based on average score. Lowest --> Highest
import matplotlib.pyplot as plt
import numpy as np
file = ["G... | github_jupyter |
# MMS Data in Python with pySPEDAS
Eric Grimes, egrimes@igpp.ucla.edu
December 4, 2019
Notes:
* this webinar will be recorded and posted to Youtube
* all of this is still beta
### Getting Started
Note: Python 3.5+ is required
To install the latest pySPEDAS:
`pip install pyspedas --upgrade`
or
`conda install -... | github_jupyter |
<img src="ine_400x141.jpg" width="200" height="200" align="right"/>
## <left>DERFE-Dirección de Estadística</left>
# <center>A crash course on Data Science with Python</center>
## <center>Motivation</center>
### <center>Part I: Data Science</center>

### <center>Part II: Become... | github_jupyter |
# Data science with IBM Planning Analytics
# Cubike example - Part 1
Cubike is a fictional Bike Sharing company that we use in the series of articles about Data Science with TM1 and Planning Analytics:
* [Part 1: Upload weather data from web services](https://code.cubewise.com/tm1py-help-content/upload-weather-data-f... | github_jupyter |
```
!curl -L https://www.dropbox.com/s/qsdq7sx946t39pa/amazon.tar?dl=1 -o amazon.tar
!tar xvf amazon.tar
import pandas as pd
import numpy as np
np.random.seed(0)
import cv2
from tqdm.notebook import tqdm
import os
from tensorflow.keras import backend as K
from tensorflow.keras.models import Sequential
from tensorflo... | github_jupyter |
# Bayesian Multilevel Modelling using PyStan
This is a tutorial, following through Chris Fonnesbeck's [primer on using PyStan with Bayesian Multilevel Modelling](http://mc-stan.org/documentation/case-studies/radon.html).
# 2. Data Import and Cleaning
```
%pylab inline
import numpy as np
import pandas as pd
```
## ... | github_jupyter |
# Classical Computation on a Quantum Computer
## Contents
1. [Introduction](#intro)
2. [Consulting and Oracle](#oracle)
3. [Taking Out the Garbage](#garbage)
## 1. Introduction <a id='intro'></a>
One consequence of having a universal set of quantum gates is the ability to reproduce any classical computation. We sim... | github_jupyter |
# Energy Meter Examples
## Linux Kernel HWMon
More details can be found at https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements#linux-hwmon.
```
import logging
from conf import LisaLogging
LisaLogging.setup()
```
#### Import required modules
```
# Generate plots inline
%matplotlib inline
import os... | github_jupyter |
```
import numpy
import urllib
import scipy.optimize
import random
from math import exp
from math import log
def parseData(fname):
for l in urllib.urlopen(fname):
yield eval(l)
print "Reading data..."
data = list(parseData("file:train.json"))
print "done"
from collections import defaultdict
train_set = data[0:1... | github_jupyter |
```
from mpes import fprocessing as fp, analysis as aly, visualization as vis, utils as u
import matplotlib.pyplot as plt
import scipy.io as sio
import numpy as np
import mpld3 # interactive plots
mpld3.enable_notebook()
```
### 4.1 Energy calibration
Consists of three steps given a set of energy dispersion curves (E... | 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 |
# Averaging over a region
Although this may not sound like _real_ regridding, averaging a gridded field
over a region is supported by `ESMF`. This works because the `conservative`
regridding method preserves the areal average of the input field. That is, _the
value at each output grid cell is the average input value o... | github_jupyter |
# Python API for Table Display
In addition to APIs for creating and formatting BeakerX's interactive table widget, the Python runtime configures pandas to display tables with the interactive widget instead of static HTML.
```
import pandas as pd
from beakerx import *
pd.read_csv('../resources/data/interest-rates.csv'... | github_jupyter |
# Introduction to Pytorch
```
import torch
```
## Tensors
Tenson is a number, vector, matrix, or any N- Dimensional array.
```
# tensor with a single number
t1 = torch.tensor(4.)
t1
t1.dtype
# more complex tensors
t2 = torch.tensor([1., 2, 3, 4])
print(t2) # ALl the tensor el... | github_jupyter |
# 🛠 03 Computer vision & convolutional neural networks in TensorFlow Exercises
3. Take 10 photos of two different things and build your own CNN image classifier using the techniques we've built here.
4. Find an ideal learning rate for a simple convolutional neural network model on your the 10 class dataset.
## 3. Tak... | github_jupyter |
# MMS in pyRFU
Louis RICHARD (louis.richard@irfu.se)
## Getting Started
To get up and running with Python, virtual environments and pyRFU, see: \
https://pyrfu.readthedocs.io/en/latest/getting_started.html#installation
Python 3.8 or later is required; we recommend installing Anaconda to get everything up and running.... | github_jupyter |
```
# # !mkdir out
!gsutil cp gs://mesolitica-general/albert-base-actual/model.ckpt-400000.data-00000-of-00001 out
!gsutil cp gs://mesolitica-general/albert-base-actual/model.ckpt-400000.index out
!gsutil cp gs://mesolitica-general/albert-base-actual/model.ckpt-400000.meta out
!mkdir albert-base-2020-04-10
!cp sp10m.ca... | github_jupyter |
# Setup
```
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from mlwpy_video_extras import (regression_errors,
regression_residuals)
import collections as co
import itertools as it
from sklearn import (datasets,
dummy,... | github_jupyter |
# Trees
```
import numpy as np
import matplotlib.pyplot as plt
% matplotlib inline
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_breast_cancer
cancer = load_breast_cancer()
print(cancer.DESCR)
X_train, X_test, y_train, y_test = train_test_split(
cancer.d... | github_jupyter |
# 3. Analysing words
This notebook will introduce you to the basics of analysing words.
You'll learn how to preprocess and represent words.
Legend of symbols:
- 🤓: Tips
- 🤖📝: Your turn
- ❓: Question
- 💫: Extra exercise
## 3.1. Word vectorization
In this section, we'll learn how to transform words into vect... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split, StratifiedKFold
from sklearn.linear_model import LogisticRegressionCV, Logisti... | github_jupyter |
# Mean Normalization
In machine learning we use large amounts of data to train our models. Some machine learning algorithms may require that the data is *normalized* in order to work correctly. The idea of normalization, also known as *feature scaling*, is to ensure that all the data is on a similar scale, *i.e.* that... | github_jupyter |
# Quantum speedups in finance
### Notebook objectives:
In this challenge we will gain the following skills:
1. Understand the basics of how financial instruments are typically priced using Monte Carlo methods
2. Implement a quantum algorithm to price a financial instrument (in this case, we consider derivative contra... | github_jupyter |
# Czech municipal elections 2018: Nové Město nad Metují
Czech municipal elections use an open-list proportional system that allows panachage - marking candidates across parties. Here, we give an example of how to evaluate such a composite election system.
```
import sys
import os
import csv
import decimal
sys.path.ap... | github_jupyter |
# PyTorch Model + Transformer Example
This notebook demonstrates how to deploy a PyTorch model and a custom transformer. It uses cifar10 model model that accepts a tensor input. The transformer has preprocessing step that allows the user to send a raw image data and convert it to a tensor input.
## Requirements
- Au... | github_jupyter |
# MNIST Image Classification with TensorFlow
This notebook demonstrates how to implement a simple linear image model on [MNIST](http://yann.lecun.com/exdb/mnist/) using the [tf.keras API](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/keras). It builds the foundation for this <a href="https://github.com/G... | github_jupyter |
```
import panel as pn
import numpy as np
import holoviews as hv
pn.extension()
```
For a large variety of use cases we do not need complete control over the exact layout of each individual component on the page, as could be achieved with a [custom template](../../user_guide/Templates.ipynb), we just want to achieve ... | github_jupyter |
# Image Captioning with RNNs
In this exercise you will implement a vanilla recurrent neural networks and use them it to train a model that can generate novel captions for images.
```
# As usual, a bit of setup
from __future__ import print_function
import time, os, json
import numpy as np
import matplotlib.pyplot as pl... | github_jupyter |
# Numpy, Estadística, Probabilidades
## Estadística
En esta parte vamos a revisar conceptos de estadística descriptiva.
La estadística descriptiva busca describir, sumarizar y comprender los datos.
Para ello empleamos Medidas de Tendencia Central, y medidas de Variabilidad.
La función de las Medidas de Tendencia C... | github_jupyter |
```
from multiprocessing import Pool
import igraph
import matplotlib.pyplot as plt
import numpy as np
import os
from scipy import stats
import time
# Import clock, accomodating different versions of time library
try:
clock = time.clock
except AttributeError:
clock = lambda : time.clock_gettime(1)
import copy
... | github_jupyter |
# Predicting Titanic Survivers
Like Titanic, this is my maiden voyage, when it comes to Kaggle contest that is!. I've completed the Data Science track on Data Camp, but I'm a relative newbie when it comes to machine learning. I'm going to attempt to work my way through the Titanic: Machine Learning contest. My aim is ... | github_jupyter |
```
%load_ext watermark
%watermark -d -u -a 'Andreas Mueller, Kyle Kastner, Sebastian Raschka' -v -p numpy,scipy,matplotlib,scikit-learn
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
```
# SciPy 2016 Scikit-learn Tutorial
# Supervised Learning Part 2 -- Regression Analysis
In regression we a... | github_jupyter |
# MNIST With SET
This is an example of training an SET network on the MNIST dataset using synapses, pytorch, and torchvision.
```
#Import torch libraries and get SETLayer from synapses
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, trans... | github_jupyter |
# Import the modules
```
# import the general modules
import cplex
import sys
# import kbase
import os
# os.environ["HOME"] = 'C:\\Users\\Andrew Freiburger\\Dropbox\\My PC (DESKTOP-M302P50)\\Documents\\UVic Civil Engineering\\Internships\\Agronne\\cobrakbase'
import cobrakbase
token = 'JOSNYJGASTV5BGELWQTUSATE4TNHZ66... | github_jupyter |
# Get your data ready for training
This module defines the basic [`DataBunch`](/basic_data.html#DataBunch) object that is used inside [`Learner`](/basic_train.html#Learner) to train a model. This is the generic class, that can take any kind of fastai [`Dataset`](https://pytorch.org/docs/stable/data.html#torch.utils.da... | github_jupyter |
<a href="https://colab.research.google.com/github/graviraja/100-Days-of-NLP/blob/applications%2Fclustering/applications/clustering/20newsgroup/Improved%20Topic%20Identification%20in%20News%20using%20LDA.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>... | github_jupyter |
# Building your Deep Neural Network: Step by Step
Welcome to your week 4 assignment (part 1 of 2)! You have previously trained a 2-layer Neural Network (with a single hidden layer). This week, you will build a deep neural network, with as many layers as you want!
- In this notebook, you will implement all the functio... | github_jupyter |
# Mounting your Google Drive
Running these two blocks of code will give the Colab environment access to your data on Google Drive. If you aren't comfortable with this idea, I'd suggest making a new Drive account dedicated to this project!
```
!apt-get install -y -qq software-properties-common python-software-properti... | github_jupyter |
# 2-Semi-Random-Independent-Set
```
import os, sys
module_path = os.path.abspath(os.path.join('../..'))
if module_path not in sys.path:
sys.path.append(module_path)
import time
import numpy as np
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import cvxgraphalgs as cvxgr
GRAPH_COLOR = ... | github_jupyter |
# Introduction
Oftentimes data will come to us with column names, index names, or other naming conventions that we are not satisfied with. In that case, you'll learn how to use pandas functions to change the names of the offending entries to something better.
You'll also explore how to combine data from multiple Data... | github_jupyter |
# Modeling and Simulation in Python
Chapter 8: Pharmacokinetics
Copyright 2017 Allen Downey
License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0)
```
# If you want the figures to appear in the notebook,
# and you want to interact with them, use
# %matplotlib noteboo... | github_jupyter |
### Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
Adapted from [Keras examples directory](https://github.com/fchollet/keras/tree/master/examples).
```
from __future__ import pr... | github_jupyter |
# Maximizing the ELBO
> In this post, we will cover the complete implementation of Variational AutoEncoder, which can optimize the ELBO objective function. This is the summary of lecture "Probabilistic Deep Learning with Tensorflow 2" from Imperial College London.
- toc: true
- badges: true
- comments: true
- author... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.