text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
import gym
import gym_oscillator
import oscillator_cpp
from stable_baselines.common import set_global_seeds
from stable_baselines.common.policies import MlpPolicy,MlpLnLstmPolicy,FeedForwardPolicy
from stable_baselines.common.vec_env import DummyVecEnv,SubprocVecEnv,VecNormalize, VecEnv
from stable_baselines impor... | github_jupyter |
```
%load_ext lab_black
import os, sys
%load_ext autoreload
%autoreload 2
import pandas as pd
from os.path import join
import scanpy as sc
import numpy as np
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
DATA_PATH = "/n/holystore01/LABS/price_lab/Users/mjzhang/scDRS_data"
df_ho... | github_jupyter |
# Documentation by example for `shap.plots.waterfall`
This notebook is designed to demonstrate (and so document) how to use the `shap.plots.waterfall` function. It uses an XGBoost model trained on the classic UCI adult income dataset (which is classification task to predict if people made over \\$50k in the 90s).
<hr... | github_jupyter |
# Data Cleansing
- [Data Understanding](#Data-Understanding)
* Reading in and Exploring Data
* Dealing with Column Names
* Slicing Dataset
- [Cleaning and Exploring Columns](#Cleaning-and-Exploring-Columns)
* [Safety & Security](#Safety-&-Security)
* [Model](#Model)
* [Make](#Make)
* [Model... | github_jupyter |
# Convolutional Neural Networks: Step by Step
Welcome to Course 4's first assignment! In this assignment, you will implement convolutional (CONV) and pooling (POOL) layers in numpy, including both forward propagation and (optionally) backward propagation.
**Notation**:
- Superscript $[l]$ denotes an object of the $l... | github_jupyter |
# Converting the indications in DrugCentral to WikiData identifiers
```
import os
import requests
import pandas as pd
from pathlib import Path
from hetnet_ml.src import graph_tools as gt
```
### Drugcentral Data Dump previously extracted from postgres dump
See [here](https://github.com/mmayers12/semmed/tree/master/p... | github_jupyter |
# Tutorial to zeolite graph distance
This tutorial illustrates the calculation of the graph distance between two zeolite structures with the supercell matching method.
This implementation was made by Daniel Schwalbe-Koda. It is compatible with the `pymatgen` and `networkx` packages. If you use this code or tutorial, ... | github_jupyter |
# Lists
Earlier when discussing strings we introduced the concept of a *sequence* in Python. Lists can be thought of the most general version of a *sequence* in Python. Unlike strings, they are mutable, meaning the elements inside a list can be changed!
In this section we will learn about:
1.) Creating lists... | github_jupyter |
```
from plangym import AtariEnvironment, ParallelEnvironment
from plangym.montezuma import Montezuma
env = AtariEnvironment(name="MsPacman-v0", clone_seeds=True, autoreset=True)
state, obs = env.reset()
env = Montezuma(autoreset=True)
state, obs = env.reset()
states = [state.copy() for _ in range(10)]
actions = [env.a... | github_jupyter |
**This notebook is an exercise in the [Time Series](https://www.kaggle.com/learn/time-series) course. You can reference the tutorial at [this link](https://www.kaggle.com/ryanholbrook/hybrid-models).**
---
# Introduction #
Run this cell to set everything up!
```
# Setup feedback system
from learntools.core import ... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#Choose-a-Topic" data-toc-modified-id="Choose-a-Topic-1"><span class="toc-item-num">1 </span>Choose a Topic</a></span></li><li><span><a href="#Analysis" data-toc-modified-... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os
plt.rcParams['axes.facecolor']='white'
plt.rcParams['figure.facecolor']='white'
```
# 0. Carga de datos
Como buena práctica para la carga de datos, es recomendado usar la función `os.path.join` de python para trabajar con directorios... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
```
# Mix of tabular + image features
```
from cape_core.tensordata import *
from cape_core.models import *
from cape_core.utils import *
from cape_core.data import *
from cape_core.ranger import *
from fastai.callbacks import SaveModelCallback
PATH = Path.cwd()
PATH.ls()
```
#... | github_jupyter |
```
# Imports
import os
import cPickle
from datetime import datetime
import pandas as pd
import numpy as np
from sklearn.preprocessing import Imputer
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import LabelBinarizer
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessi... | github_jupyter |
# *Circuitos Elétricos I - Primeiro Estágio 2020.1e*
## Gabarito da avaliação
```
m = [9,1,6] # últimos dígitos da matrícula
import numpy as np
import sympy as sp
```
### Problema 1
a. $R_{eq}=?$
```
# define valores das resistências
R1 = (m[0]+1)*1e3
R2 = (m[1]+1)*1e3
R3 = (m[2]+1)*1e3
Req = ((R1+R3)*2*R3)/(R1+3... | github_jupyter |
# Computational and Numerical Methods
## Group 16
### Set 10 (08-10-2018): The Jacobi Iteration Method and the Gauss-Seidel Method
#### Vidhin Parmar 201601003
#### Parth Shah 201601086
```
import numpy as np
def JacobiAndGaussSeidel(A, b):
ITERATION_LIMIT = 100
print("Jacobian Method:")
print()
... | github_jupyter |
```
from tensorflow.keras.applications.mobilenet import preprocess_input
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import numpy as np
import tensorflow as tf
from tensorflow.keras.datasets import cifar10
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.... | github_jupyter |
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import pickle
import tensorflow_probability as tfp
tfd = tfp.distributions
tf.test.is_gpu_available()
def sample_data():
count = 100000
rand = np.random.RandomState(0)
a = [[-1.5, 2.5]] + rand.randn(count // 3, 2) * 0.2
b = [... | github_jupyter |
# Exemplo de uso Tensorboard com MNIST
O Tensorboard é uma ferramenta integrada ao tensorflow que permite a visualização de estatísticas de uma rede neural como parâmetros de treinamento (perda, acurácia e pesos), imagens e o grafo construído. Ele é útil para ajudar a entender o fluxo dos tensores no grafo e também co... | github_jupyter |
```
# Insert code here.
import pandas as pd
import numpy as np
import random
import re
import time
import datetime
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize
from sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm, neighbors
from sklearn.preprocessing i... | github_jupyter |
Deep learning algorithms fail to work well if we have only one training example.
One-shot learning is a classification or object categorization task in which one or a few examples are used to classify many new examples.
The principle behind one-shot learning is Humans learn new concepts with very little supervision.
... | github_jupyter |
# MNIST Classifier Model
## Goal
Now that we have created a model that can classify 3's and 7'2, lets create a model for the entire MNIST dataset with all the numbers 0-9.
```
#hide
!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
#hide
from fastai.vision.all import *
from fastbook import *
matplotl... | github_jupyter |
```
import cv2
from matplotlib import pyplot as plt
import numpy as np
import imutils
import easyocr
from os import listdir
from os.path import isfile, join
img = cv2.imread(r"D:\5_Integrationsseminar\Aufnahmen\still2.jpg")
#img = cv2.imread(r"D:/5_Integrationsseminar/Bilder/small/KZE_008.jpg")
dir=r"D:\5_Integrationss... | github_jupyter |
```
# Get helper_functions.py script from course GitHub
!wget https://raw.githubusercontent.com/mrdbourke/tensorflow-deep-learning/main/extras/helper_functions.py
# Import helper functions we're going to use
from helper_functions import create_tensorboard_callback, plot_loss_curves, unzip_data, walk_through_dir
impor... | github_jupyter |
# Image classification using CNN
## Load the data
```
import pickle
import matplotlib.pyplot as plt
import tensorflow as tf
from os.path import join
from sklearn.preprocessing import OneHotEncoder
import numpy as np
def loadCifarData(basePath):
trainX = []
testX = []
trainY = []
testY = []
... | github_jupyter |
# Machine learning with SPARK in SQL Server 2019 Big Data Cluster
Spark in Unified Big data compute engine that enables big data processing, Machine learning and AI
Key Spark advantages are
1. Distributed compute enging
2. Choice of langauge (Python, R, Scala, Java)
3. Single engine for Batch and Streaming job... | github_jupyter |
```
print('The Station {}'.format(station_id)+' has {} docks in total.'.format(station.loc[station_id,'install_dockcount']))
#Station by station
extract = trip.loc[(trip.from_station_id==station_id) | (trip.to_station_id==station_id),:]
def incrementation(row):
if (row['from_station_id']==station_id)&(row['to_sta... | github_jupyter |
```
import pymc3 as pm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
%qtconsole --colors=linux
plt.style.use('ggplot')
```
# Chapter 3 - Inferences with binomials
## 3.1 Inferring a rate
Inferring the rate $\theta$ of a binar... | github_jupyter |
# Introducción al Cálculo Científico
En esta clase introduciremos algunos conceptos de computación cientifica en Python, principalmente utilizando la biblioteca `NumPy`, piedra angular de otras librerías científicas.
## SciPy.org
**SciPy** es un ecosistema de software _open-source_ para matemática, ciencia y engenie... | github_jupyter |
# Article Spinning Intro
* Changing certain words of an article so it does not match the original, so a search engine can't mark it as duplicate content
* How is this done:
* take an article and slightly modify it, different terms, same meaning
* "Udemy is a **platform** or **marketplace** for online **learning... | github_jupyter |
# Deriving a vegetation index from 4-band satellite data
A **vegetation index** is generated by combining two or more spectral bands from a satellite image. There are many different vegetation indices; in this exercise we'll learn about the most commonly-used index.
### NDVI
Researchers often use a vegetation index ... | github_jupyter |
<!-- Autogenerated by `scripts/make_examples.py` -->
<table align="left">
<td>
<a target="_blank" href="https://colab.research.google.com/github/voxel51/fiftyone-examples/blob/master/examples/open_images_evaluation/open_images_evaluation.ipynb">
<img src="https://user-images.githubusercontent.co... | github_jupyter |
<h1> Preprocessing using Dataflow </h1>
This notebook illustrates:
<ol>
<li> Creating datasets for Machine Learning using Dataflow
</ol>
<p>
While Pandas is fine for experimenting, for operationalization of your workflow, it is better to do preprocessing in Apache Beam. This will also help if you need to preprocess da... | github_jupyter |
```
%pylab inline
import cmath
def get_zero_sequence_impedance(sequence_impedance_matrix):
try:
return sequence_impedance_matrix[0,0]
except:
raise ValueError('sequence_impedance_matrix is not valid.')
def get_positive_sequence_impedance(sequence_impedance_matrix):
try:
retu... | github_jupyter |
here uplode ur own token from kaggle or seach on google
otherwise follow this link
https://stackoverflow.com/questions/49310470/using-kaggle-datasets-in-google-colab
```
from google.colab import files
files.upload()
!pip install -q kaggle
!mkdir -p /root/.kaggle
!cp /content/kaggle.json /root/.kaggle
#!kaggle datase... | github_jupyter |
```
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.tokenize import RegexpTokenizer
from nltk import pos_tag
from nltk.stem import PorterStemmer, WordNetLemmatizer
import re
import nltk
import pprint as pp
import db_scripts
import pprint
import pickle
import json
def get_credentials(... | github_jupyter |
# Visualization
## TODO: k-NN + directed version (direction = style)
```
import collections
import numpy as np
import time
import datetime
import json
from tqdm import tqdm
import os
import tensorflow as tf
import seaborn as sns
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
plt.rcParams.update({
"text.usetex": True,
"font.sans-serif": ["Helvetica"]})
```
# Driving forces for moving systems
In this case study, you want to accelerate a 0.1-kg flywheel with a
piston. The desired
acceleration of the ... | github_jupyter |
<a href="https://colab.research.google.com/github/yohanesnuwara/66DaysOfData/blob/main/D14_EDA_NLP.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Exploratory Data Analysis for NLP
```
import numpy as np
import pandas as pd
import matplotlib.pypl... | github_jupyter |
# Assignment 4
Before working on this assignment please read these instructions fully. In the submission area, you will notice that you can click the link to **Preview the Grading** for each step of the assignment. This is the criteria that will be used for peer grading. Please familiarize yourself with the criteria b... | github_jupyter |
```
import os
import sys
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit, fminbound
from scipy import stats as st
from tableanalyser import discretize_df_columns, plotvarmen, plotcv2mean, plotoversigmacv2, getovergenes, plotoverpoints
from tacos_plot impo... | github_jupyter |
# Serving Deep Learning Models
```
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.read_csv('../data/wifi_location.csv')
df.head()
df['location'].value_counts()
df.plot(figsize=(12, 8))
plt.axvline(500)
plt.axvline(1000)
plt.axvline(1500)
plt.title('Indoor location dat... | github_jupyter |
### Load Libraries
```
import pandas as pd
import numpy as np
import os, sys, glob, json, pickle
import seaborn as sn
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn.metrics import accuracy_score, f1_score, recall_score, cohen_kappa_score
from sklea... | github_jupyter |
# Script to perform some basic data exploration
```
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
path_to_dataset = "/home/shagun/FortKnox/Quora/quora_duplicate_questions.tsv"
# Load the dataset into a pandas dataframe
df = pd.read_csv(path_to_dataset, delimiter... | 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 |
# OpenML CC18 Metalearning Benchmark
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pandera as pa
import plotly.express as px
import re
import seaborn as sns
from pathlib import Path
# environment variables
JOB = 338
RESULTS_ROOT = Path("..") / "floyd_outputs"
```... | github_jupyter |
```
import pandas as pd
import numpy as np
import pandas as pd
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import math
import seaborn as sns
import matplotlib.colors as mcolors
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmodels.formula.api import ols
from stat... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
import sys
sys.path.append("..")
import source.explore as exp
pd.set_option('max_columns', 200)
```
From a previous run, we have the out of folds predictions over our training set. We put it together ... | github_jupyter |
```
# default_exp models.layers
```
# Layers
> Helper function used to build PyTorch timeseries models.
```
#export
from torch.nn.init import normal_
from fastai.torch_core import Module
from fastai.layers import *
from torch.nn.utils import weight_norm, spectral_norm
from tsai.imports import *
from tsai.utils impor... | github_jupyter |
```
import logging
import pickle
import numpy as np
import pandas as pd
from gensim.models.word2vec import Word2Vec
from gensim.models import KeyedVectors
from tqdm import tqdm
from sklearn.mixture import GaussianMixture
from sklearn.feature_extraction.text import TfidfVectorizer,HashingVectorizer,CountVectorizer
fro... | github_jupyter |
```
import folium
import folium
map_osm = folium.Map(location=[37.7549, -122.4194], zoom_start=13, detect_retina=True,
tiles='http://tile.stamen.com/watercolor/{z}/{x}/{y}.jpg', attr='Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/... | github_jupyter |
## <b> Scientific modules and IPython <b/>
```
%matplotlib inline
import matplotlib.pylab as plt
```
#### <b>Core scientific packages<b/>
Python is not doing your science, the packages are doing it. Some of them are here:
<img style="width:1000px;" src="core.png">
[Source of this figure](http://chris35wills.github... | github_jupyter |
```
# https://docs.gdc.cancer.gov/API/Users_Guide/Search_and_Retrieval/
import requests
import json
import boto3
import re
import gzip
import pandas as pd
import dask
from dask.distributed import Client
data_endpt = 'https://api.gdc.cancer.gov/data'
cases_endpt = 'https://api.gdc.cancer.gov/cases'
files_endpt = 'http... | github_jupyter |
```
import numpy as np
import pandas as pd
import xarray as xr
import glob
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
thedir = '/glade/scratch/djk2120/mini_ens/'
f = 'miniens_oaat'+'0001'+'_h0.nc'
#for use on Casper
from dask_jobqueue import SLURMCluster
from dask.distributed import Client
clu... | github_jupyter |
# Introduction
This notebook shows how to evaluate neural cross-lingual summarization (xls) presented in paper [A Deep Reinforced Model for Zero-Shot Cross-Lingual Summarization
with Bilingual Semantic Similarity Rewards](https://arxiv.org/pdf/2006.15454.pdf) . Their original codes are available at [zdou0830/crosslingu... | 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 |
# CLUSTERING
### Importamos las librerías
```
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA as sklearnPCA
from sklearn.preproce... | github_jupyter |
```
# %%
import math
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.animation import FuncAnimation
from scipy.stats import bernoulli
from svgpathtools import svg2paths
from svgpath2mpl import parse_path
# matplotlib parameters to ensure... | github_jupyter |
# Image Colorization with U-Net and GAN Tutorial
**If you have already read the explanations, you can directly go to the code starting with heading: _1 - Implementing the paper - Our Baseline_**

查看正在使用的数据之后,了解图像与关键点的形状,接下来,就可以定义一个机器人可以从这些数据中 *学习*的卷积神经网络。
在这个notebook和`models.py`中,你的任务是:
1. 定义一个CNN,把图像作为输入,把关键点作为输出
2. 与以前一样,构造转换后的FaceKeypointsDataset
3. 使用训练数据训练这个CNN,并跟踪损失
4. 查看训练模型对测试数据的执行情况
5. 如有必要,请修改CNN结构并模拟超参数,使其*表现良好* **\***
**\*** 什么是*表现良好*?
“表现良好”意味着该模型的损失在训练期间有所降低,**而且**该模型应用于测试图像数... | github_jupyter |
## Python not in the Notebook
We will often want to save our Python classes, for use in multiple Notebooks.
We can do this by writing text files with a .py extension, and then `importing` them.
### Writing Python in Text Files
You can use a text editor like [VS Code](https://code.visualstudio.com/) or [Spyder](https... | github_jupyter |
You may want to make use of parts of .net that aren't default opened
```
System.Windows.Forms.DataVisualization //WebClient / System.NET
#r "System.Windows.Forms.DataVisualization.dll"
System.Windows.Forms.DataVisualization.Charting.Point3D()
```
You can also use this with your own libraries:
```
#r "../../somewhere... | github_jupyter |
```
import os,sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pylab as P
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.cm as cm, matplotlib.font_manager as fm
sns.set(style="darkgrid")
import matplotlib.patheffects as PathEffects
from matplotlib.ticker impor... | github_jupyter |
```
import pandas as pd
import numpy as np
import time
import operator
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.metrics import log_loss, f1_score, accuracy_score
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
trn = ... | github_jupyter |
# Preferential Bayesian Optimization: Dueling-Thompson Sampling
Implementation of the algorithm by Gonzalez et al (2017).
```
import numpy as np
import gpflow
import tensorflow as tf
import tensorflow_probability as tfp
import matplotlib.pyplot as plt
import sys
import os
import datetime
import pickle
from gpflow.ut... | github_jupyter |
Welcome back, folks! In this series of 3 blog post, we will be discussing pandas which one of my favorite python libraries. We will go through 74 exercises to solidify your skills with pandas and as usual, I will explain the WHY behind every single exercise.
Pandas is a powerful open-source library for data analysis a... | github_jupyter |
```
# default_exp data
```
# Data
> This module contains functions to download and preprocess the data
```
#hide
from nbdev.export import notebook2script
#export
import ee
import os
import requests
import rasterio
import pandas as pd
import numpy as np
import zipfile
import json
from IPython.core.debugger import set_... | github_jupyter |
# GraphRNN
```
!git clone --single-branch --branch colab https://github.com/joaopedromattos/GraphRNN
!pip install gdown
!gdown --id 1RF_bIo5ndxPhu9SJw-T8HBcuHyaGQGL0 && tar -xzvf datasets.tar.gz
!mv GraphRNN/* .
!mkdir ./dataset/EVENT
```
## Preparing our graph
```
import networkx as nx
import numpy as np
G = nx.re... | github_jupyter |
## 神经网络实现翻译
- 参考链接 : https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
- 论文参考链接 : https://arxiv.org/abs/1409.3215
In this project we will be teaching a neural network to translate from French to English.
最终实现的目标如下
```python
[KEY: > input, = target, < output]
> il est en train de peindre... | github_jupyter |
## Python File Operations
# Binary Files
```
with open("myfile.bin", "wb") as f:
f.write(b'\x30\x31\x09\x32\x20\x52\x43\x53\x0A\x51\xFE\x00\xFF') # notice b prefix!!
with open("myfile.bin", "r") as f:
lines=f.readlines()
f.seek(0)
text=f.read()
print(lines)
print(lines[0])
print(text)
```
ASCII Codes... | github_jupyter |
```
import os
import pandas as pd
import matplotlib.pyplot as plt
from keras.applications.vgg16 import VGG16
from keras.models import Model
from keras.callbacks import ModelCheckpoint,EarlyStopping
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import np_utils
from keras.models import Sequent... | github_jupyter |
# TPR : From symbols to tensors
__(Cho, Goldrick & Smolensky 2016)__
## Data
This notebook tries to illustrate how to use Tensor Product Representation (TPR) to represent discrete or gradient blend structures. The concrete examples apply TPR to root allomorphy. In Sanskrit and Greek, for instance, we have a phenomen... | github_jupyter |
Handling models in GPflow
--
*James Hensman November 2015, January 2016*,
*Artem Artemev December 2017*
One of the key ingredients in GPflow is the model class, which allows the user to carefully control parameters. This notebook shows how some of these parameter control features work, and how to build your own model... | github_jupyter |
```
import scanpy as sc
import squidpy as sq
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from squidpy.pl._utils import save_fig
from time import process_time
sc.logging.print_header()
sc.set_figure_params(facecolor="white", figsize=(8, 8))
sc.settings.verbosity = 1
sc.... | github_jupyter |
<a href="https://colab.research.google.com/github/kartikgill/The-GAN-Book/blob/main/Skill-01/Pixel-CNN-for-MNIST.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Importing useful libraries
```
import numpy as np
import matplotlib.pyplot as plt
imp... | github_jupyter |
```
import os
import sys
import glob
import itertools
import random
from IPython.display import Image
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from matplotlib.colors import ListedColormap
from scipy.stats import multivariate_normal
import numpy as np
import pandas as pd
from s... | github_jupyter |
- V1 : LGBM STACKING
- V2 : LGBM, MLP16 STACKING
- V3 : V2 + pred 5 score 3
```
import warnings
warnings.filterwarnings('ignore')
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm_notebook
from sklearn import svm, neighbors, linear_model, ne... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/W2D1-postcourse-bugfix/tutorials/W2D1_BayesianStatistics/W2D1_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Neuromatch Academy: Week 2, Day 1, Tuto... | github_jupyter |
# 1. Run-Length Encoding
See Answer for Lab 04
# 2. Weave 1
```
weave_first_series = [i for i in range(1, 11)]
weave_second_series = [i for i in range(10, 0, -1)]
weave_answer = [1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1]
def weave(first_series, second_series):
output = []
# W... | github_jupyter |
```
import os, glob
import numpy as np
import pandas as pd
from calendar import monthrange,month_name
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
%matplotlib inline
fs = 18
plt.rc('font', family='serif')
plt.rc('font', size=18)
# date parser for pandas
dp = lambda x: pd.datetime.strptime(x,'%d-%m-%Y... | github_jupyter |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Start-to-Finish Example: Head-On Black Hole Collision
##... | github_jupyter |
```
%pylab inline
import seaborn as sns
sns.set_style('white')
import pandas as pd
import torch
import torch.nn as nn
from src.data.cmnist_dist import make_joint_distribution
from src.discrete.distribution import DiscreteDistribution, compute_ce, compute_kl
from src.discrete.distribution.plot import plot_data
from ... | github_jupyter |
# Principle Component Analysis (PCA)
* Unsupervised learning method
* Difficult to understand components beyond which have highest variance
* Good step to do at end of processing because of way data gets transformed and reshaped
References:
* [Dimensionality Reduction in Python](https://campus.datacamp.com/courses/d... | github_jupyter |
# Bytecode Processing
```
import os;
os.getpid()
import hybridcuda
import json
def inspection(f):
hc = hybridcuda.disassemble(f)
print('=== hybrid ===')
print(hc['hybrid'])
print('=== inspect ===')
print(hc['inspect'])
def validate(f):
hc = hybridcuda.disassemble(f)
parsedinspect = json.l... | github_jupyter |
# How to perform aperture photometry with custom apertures?
We have discussed in previous tutorials how Simple Aperture Photometry works. We choose a set of pixels in the image and sum those to produce a single flux value. We sum the same pre-selected pixels for every image at each time slice to produce a light curve.... | github_jupyter |
# Bytes Data Type
**ToDo**:
- Add an illustration and explain the concept of UTF-8, Unicode, Bytes, ASCII - Similar to [this](https://blog.finxter.com/wp-content/uploads/2020/06/byte-1024x576.jpg)
- Add relevant resources at the end
---
Most cryptographic functions require [Bytes](https://docs.python.org/3/library/st... | github_jupyter |
# Process the Unsplash dataset with CLIP
This notebook processes all the downloaded photos using OpenAI's [CLIP neural network](https://github.com/openai/CLIP). For each image we get a feature vector containing 512 float numbers, which we will store in a file. These feature vectors will be used later to compare them t... | github_jupyter |
```
import requests, datetime, time, pytz
from pyquery import PyQuery as pq
from dataflows import Flow, printer, dump_to_path, sort_rows
def get_messages(before_id=None):
url = 'https://t.me/s/MOHreport'
if before_id:
url += '?before=' + str(before_id)
print('loading ' + url)
for message in pq... | github_jupyter |
# LUSD Pool Model
```
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import dates as md
from matplotlib import ticker
import scipy as scp
import scipy.optimize as opt
import csv
import math
import random
import pandas as pd
import copy
from datetime import datetime, timedelta
```
## Core Idea... | github_jupyter |
# Tutorial 08: Creating Custom Environments
This tutorial walks you through the process of creating custom environments in Flow. Custom environments contain specific methods that define the problem space of a task, such as the state and action spaces of the RL agent and the signal (or reward) that the RL algorithm wil... | 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 |
# Science User Case - Inspecting a Candidate List
Ogle et al. (2016) mined the NASA/IPAC Extragalactic Database (NED) to identify a new type of galaxy: Superluminous Spiral Galaxies.
Here's the paper: https://ui.adsabs.harvard.edu//#abs/2016ApJ...817..109O/abstract
Table 1 lists the positions of these Super Spirals.... | github_jupyter |
```
# default_exp solvers
```
# solvers
> algorithms to solve the MAP problems
```
#export
from thompson_sampling.abstractions import AbstractSolver, AbstractContextualSolver,AbstractContextualSolverSingleModel
import numpy as np
import scipy.stats as stats
import matplotlib.cm as cm
import matplotlib.pyplot as plt
i... | github_jupyter |
# Excercises Electric Machinery Fundamentals
## Chapter 4
## Problem 4-29
```
%pylab notebook
```
### Description
A 100-MVA, 14.4-kV 0.8-PF-lagging, Y-connected synchronous generator has a negligible armature
resistance and a synchronous reactance of 1.0 per-unit. The generator is connected in parallel with a 60-
H... | github_jupyter |
```
import sys
import tensorflow as tf
from tensorflow.keras import layers, activations, losses, Model, Input
from tensorflow.nn import leaky_relu
import numpy as np
from itertools import combinations
from tensorflow.keras.utils import plot_model, Progbar
import matplotlib.pyplot as plt
from sklearn.model_selection imp... | github_jupyter |
```
import logging
logging.basicConfig(level="INFO", format="[%(name)s - %(levelname)s] %(message)s")
ROOT = logging.getLogger()
import pandas as pd
import sanger_sequencing
from pandas import read_excel
def tube_samples(filepath):
"""Read the particular excel file into a pandas.DataFrame."""
df = read_excel(f... | github_jupyter |
```
%matplotlib inline
import pandas as pd
import numpy as np
import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
from scipy import stats
# dataset test
from sklearn.datasets import make_blobs
X, y =make_blobs(n_samples=50, centers = 2,random_state = 0, cluster_std = 0.60)
plt.scatter(X[:,0],X[:,1],c=y,cma... | github_jupyter |
```
import numpy as np
from matplotlib import pyplot as plt
import baseline
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
import scipy.fftpack as F
%pylab inline
data = baseline.prepare_data('/Users/daphne/Dropbox (MIT)/pd-mlhc/CIS')
subject_ids, measurement_ids, all_data, all_n_da... | github_jupyter |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Start-to-Finish Example: Setting up Polytropic [TOV](http... | github_jupyter |
# Custom Display Logic
## Overview
As described in the [Rich Output](Rich Output.ipynb) tutorial, the IPython display system can display rich representations of objects in the following formats:
* JavaScript
* HTML
* PNG
* JPEG
* SVG
* LaTeX
* PDF
* Markdown
This Notebook shows how you can add custom display logic ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.