text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# Tutorial Title
Your name
Tutorial Date
---
# Overview
If you have an introductory paragraph, lead with it here! Then continue into the required list of topics below:
1. Ideally These should map approximately to your main sections of content
2. Or each second-level, ##, header in this tutorial notebook
3. Keep th... | github_jupyter |
# Basic Condorcet
For a quick test, let's look at basic Condorcet voting. Recall that Condorcet looks for the option that wins all pairwise majority elections against every other option. Consider the set of agents $N = \{ A, B, C, D\}$ voting over solutions $\{1, 2, 3, 4\}$ and the following preference profile:
<div>... | github_jupyter |
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import numpy as np
from sklearn.manifold import TSNE
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from scipy.spatial.distance imp... | github_jupyter |
```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import csv
import os
import re
from matplotlib.ticker import MultipleLocator, FormatStrFormatter, AutoMinorLocator
FOLDER = "logs"
files = os.listdir(FOLDER)
len(files)
def label_replace(attn_name, update_rule):
model_... | github_jupyter |
# Custom Mini-Batch and Training loop
### Imports
```
import Python
let request = Python.import("urllib.request")
let pickle = Python.import("pickle")
let gzip = Python.import("gzip")
let np = Python.import("numpy")
let plt = Python.import("matplotlib.pyplot")
import TensorFlow
```
### MNIST
Data
```
let result ... | github_jupyter |
# Example 1
Trying out the example codes in https://github.com/marinkaz/scikit-fusion
```
import pylab as plt
import matplotlib
from IPython.display import display, HTML
import numpy as np
import pandas as pd
from skfusion import fusion
%matplotlib inline
R12 = np.random.rand(50, 100)
R13 = np.random.rand(50, 40)
R... | github_jupyter |
# Working with Unknown Dataset Sizes
This notebook demonstrates the features built into OpenDP to handle unknown or private dataset sizes.
### Load exemplar dataset
```
import os
data_path = os.path.join('.', 'data', 'PUMS_california_demographics_1000', 'data.csv')
with open(data_path) as data_file:
data = data_... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import sys, os
import matplotlib.pyplot as plt
sys.path.append(os.path.join('..'))
from FACT.helper import *
from FACT.fairness import *
from FACT.data_util import *
from FACT.plot import *
from FACT.lin_opt import *
# Fair Data
X_train, y_train, X_test, y_tes... | github_jupyter |
```
import glob
import os
import pickle
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
import numpy as np
import datetime as dt
from ta import add_all_ta_features
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics impor... | github_jupyter |
```
import numpy as np
import sklearn.datasets as sk_dataset
from sklearn.model_selection import train_test_split, KFold
from scipy.io import loadmat
n_node = 10 # num of nodes in hidden layer
lam = 1 # regularization parameter, lambda
weight_range = [-1, 1] # range of random weights
bias_range = [0, 1] # range of rand... | github_jupyter |
```
import numpy as np
import pandas as pd
import pathlib
import os
os.chdir('..')
import warnings
warnings.simplefilter('ignore')
from fp.traindata_samplers import CompleteData
from fp.missingvalue_handlers import CompleteCaseAnalysis
from fp.dataset_experiments import GermanCreditDatasetSexExperiment
from fp.scale... | github_jupyter |
```
import os
import sys
module_path = os.path.abspath(os.path.join('../../src'))
print(module_path)
if module_path not in sys.path:
sys.path.append(module_path)
import csv
from pathlib import Path
from os import listdir
import pickle
from labeling_utils import load_labels
import numpy as np
from sklearn.metric... | github_jupyter |
# 3 Branches
So far we have concentrated mainly on sequential programs with a single pathway through them, where the flow of control proceeds through the program statements in linear sequence, except when it encounters a loop element. If a loop is encountered, then the control flow is redirected back ‘up’ the program ... | github_jupyter |
# Amazon sentiment analysis: Structural correspondence learning
Data downloaded from: processed_acl.tar.gz, processed for John Blitzer, Mark Dredze, Fernando Pereira. Biographies, Bollywood, Boom-boxes and Blenders: Domain Adaptation for Sentiment Classification. Association of Computational Linguistics (ACL), 2007
M... | github_jupyter |
# Understanding Deepfakes with Keras
```
!pip3 install tensorflow==2.1.0 pillow matplotlib
!pip3 install git+https://github.com/am1tyadav/tfutils.git
%matplotlib notebook
import tensorflow as tf
import numpy as np
import os
import tfutils
from matplotlib import pyplot as plt
from tensorflow.keras.layers import Dense... | github_jupyter |
```
# Copyright 2021 Google LLC
#
# 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 |
# Backtest a Single Model
The way to gauge the performance of a time-series model is through re-training models with different historic periods and check their forecast within certain steps. This is similar to a time-based style cross-validation. More often, we called it `backtest` in time-series modeling.
The purpo... | github_jupyter |
# Making a new material file
**Optional**: build protocol buffer package
```
!protoc --python_out=. -I=../proto ../proto/material.proto
```
Import library. Note: if you get an error that says "no module named google," make sure you have protobuf python library installed (try `pip install protobuf`)
```
import mater... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/gdrive')
import pandas as pd
import glob
import datetime as dt
import multiprocessing as mp
from datetime import datetime
import numpy as np
import plotly
from pandas import Series
import sys
from scipy import stats
import os
from sklearn.pipeline import Pipel... | github_jupyter |
<a href="https://colab.research.google.com/github/ksdkamesh99/LowLightEnhancer/blob/master/model_gradient.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import drive
drive.mount('/content/drive')
cd /content/drive/My Drive/Low... | github_jupyter |
```
!unzip Images.zip
!unzip Airplanes_Annotations.zip
import os,cv2,keras
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
path = "Images"
annot = "Airplanes_Annotations"
for e,i in enumerate(os.listdir(annot)):
if e < 10:
filename = i.split(".")[0]+".jpg"
... | github_jupyter |
# Imports
The following packages will be used:
1. tensorflow
2. numpy
3. pprint
```
%%capture
!pip install --upgrade wandb
import wandb
from wandb.keras import WandbCallback
wandb.login()
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import... | github_jupyter |
# Iteratief ontwerpen
Overal herhalingen

Oneindige fractals ... Zie [Xaos](https://xaos-project.github.io/) voor de hypnotiserende ervaring!
## Herhalingen
`while` met ontsnapping!
```
from random import choice
def escape(hidden):
guess = 0
count = 0
w... | github_jupyter |
### 2. 학습 데이터 준비
```
# PyTorch 라이브러리 임포트
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset
# pandas 라이브러리 임포트
import pandas as pd
# NumPy 라이브러리 임포트
import numpy as np
# matplotlib ... | github_jupyter |
# Introduction
This sample notebook takes you through an end-to-end workflow to demonstrate the functionality of SageMaker Ground Truth and Amazon Rekognition Custom Labels
```
import datetime
import tarfile
import boto3
import os
from sagemaker import get_execution_role
import sagemaker
from IPython.display import H... | github_jupyter |
# Cálculo promedio de remuneración UNRC
Según datos oficiales extraídos del sistema de información de la UNRC y declaraciones públicas varias.
Se extrae de **Recursos humanos UNRC**: [Estadísticas Sireh](https://sisinfo.unrc.edu.ar/estadisticas/estadisticas_sireh.php) la cantidad de personal clasificados según *categ... | github_jupyter |
```
# ECE 180 python project
# Global imports
import urllib2
from StringIO import StringIO
import gzip
import sys
import os
import numpy as np
import pandas as pd
import gmaps
import matplotlib.pyplot as plt
import seaborn
import itertools
import csv
%matplotlib inline
# Use this to set the env api key
# os.environ['... | github_jupyter |
# FBSDE
Ji, Shaolin, Shige Peng, Ying Peng, and Xichuan Zhang. “Three Algorithms for Solving High-Dimensional Fully-Coupled FBSDEs through Deep Learning.” ArXiv:1907.05327 [Cs, Math], February 2, 2020. http://arxiv.org/abs/1907.05327.
```
%load_ext tensorboard
import os
from makers.gpu_utils import *
os.environ["CUDA... | github_jupyter |
<a href="https://colab.research.google.com/github/JavaFXpert/qiskit4devs-workshop-notebooks/blob/master/grover_search_party.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Using Grover search for boolean satisfiability
### *Throwing a party while... | github_jupyter |
# T1049 - System Network Connections Discovery
Adversaries may attempt to get a listing of network connections to or from the compromised system they are currently accessing or from remote systems by querying for information over the network.
An adversary who gains access to a system that is part of a cloud-based env... | github_jupyter |
```
# Statistics
import pandas as pd
import numpy as np
import math as mt
# Data Visualization
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# Data Preprocessing - Standardization, Encoding, Imputation
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import Norma... | github_jupyter |
<img src="https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left">
# _*Quantum Tic-Tac-Toe*_
The latest version of this notebook is available ... | github_jupyter |
<small><small><i>
All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/01_Python_Introduction)**
</i></small></small>
# Python Statement, Indentation and Comments
In this class, you will learn about Python statements, why indentation is important a... | github_jupyter |
# XLA in Python
[](https://colab.sandbox.google.com/github/google/jax/blob/master/docs/notebooks/XLA_in_Python.ipynb)
<img style="height:100px;" src="https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/compiler/xla/g3doc/i... | github_jupyter |
```
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
from models import SimpleModel, ConcreteModel, ConcreteDropout, normal_nll
torch.manual_seed(2809)
np.random.seed(2809)
torch.cuda.m... | github_jupyter |
```
##### Import packages
# Basic packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Modelling packages
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import cross_val_score
from sk... | github_jupyter |
# Autokeras
[PCoE][pcoe]の No.6 Turbofan Engine Degradation Simulation Dataset に対して [Autokeras][autokeras] を利用したAutoMLの実行テスト。
[autokeras]: https://autokeras.com/
[pcoe]: https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository/
# Install Autokeras
```
try:
import autokeras as ak
except ModuleNotF... | github_jupyter |
<img src="https://jaipresentation.blob.core.windows.net/comm/jai_avatar.png" width="100" align="right"/>
# JAI - Trust your data
## Fill: leverage JAI to smart-fill your missing data
This is an example of how to use the fill missing values capabilities of JAI.
In this notebook we will use a subset of the [PC Games 2... | 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 |
# x-filter Overlay - Demostration Notebook
通过HLS高层次综合工具,可以很方便的通过C/C++语言将算法综合为可在Vivado中直接例化的硬件IP,利用FPGA并行计算的优势,帮助我们实现算法加速,提高系统响应速度。在本示例中通过HLS工具实现了一个阶数与系数均可实时修改的FIR滤波器IP。
x-filter Overlay实现了对该滤波器的系统集成,Block Design如下图所示,ARM处理器可通过AXI总线和DMA访问该IP。
<img src="./images/x-order_filter.PNG"/>
*注:Overlay可以理解为具体的FPGA比特流 + 相应的Pyth... | github_jupyter |
#### Script for downloading a ground truth non-subtweets dataset
#### Import libraries for accessing the API and managing JSON data
```
import tweepy
import json
```
#### Load the API credentials
```
consumer_key, consumer_secret, access_token, access_token_secret = (open("../../credentials.txt")
... | github_jupyter |
```
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import *
from collections import Counter
import seaborn as sns
import pandas as pd
from tqdm import tqdm
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
IMAGE_DIR = 'image_contest_level_2'
CROP_DIR = 'cro... | github_jupyter |
# Publishing SDs, Shapefiles and CSVs
Publishing your data can be accomplished in two simple steps:
1. Add the local data as an item to the portal
2. Call the publish() method on the item
This sample notebook shows how different types of GIS datasets can be added to the GIS, and published as web layers.
```
from IPy... | github_jupyter |
## Write SEG-Y with `obspy`
Before going any further, you might like to know, [What is SEG-Y?](http://www.agilegeoscience.com/blog/2014/3/26/what-is-seg-y.html). See also the articles in [SubSurfWiki](http://www.subsurfwiki.org/wiki/SEG_Y) and [Wikipedia](https://en.wikipedia.org/wiki/SEG_Y).
We'll use the [obspy](ht... | github_jupyter |
```
from lxml import etree as ET
import json
import os
import pprint
#temp create template json without config
test = open('mif/defParse300.json',)
print(test)
jsontest = json.load(test)
print(jsontest)
#jsontest = json.load(open('30382939.xml'))
recordTree = ET.parse('30382939.xml')
#print(recordTree.tostring())
#pr... | github_jupyter |
# Prepare and Deploy a TensorFlow Model to AI Platform for Online Serving
This Notebook demonstrates how to prepare a TensorFlow 2.x model and deploy it for serving with AI Platform Prediction. This example uses the pretrained [ResNet V2 101](https://tfhub.dev/google/imagenet/resnet_v2_101/classification/4) image clas... | github_jupyter |
# Question 1a: %timeit
You may know from your experiences with matlab that you should always prefer vector- or matrix-based operations over for loops, if possible (hence the name **mat**(rix)**lab**(oratory)). The same is true of python -- you should prefer numpy-array-based operations over for loops. This will also be... | github_jupyter |
### Generating human faces with Adversarial Networks
<img src="images/nvidia_cool_gan.png" width="400px"/>
_© research.nvidia.com_
This time we'll train a neural net to generate plausible human faces in all their subtlty: appearance, expression, accessories, etc. 'Cuz when us machines gonna take over Earth, there won'... | github_jupyter |
# 3D MNIST
https://medium.com/shashwats-blog/3d-mnist-b922a3d07334
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
from matplotlib import animation
# import seaborn as sns
import h5py
import os, sys
sys.path.append('data/')
from voxelgrid import VoxelGrid
from... | github_jupyter |
# Convolutional Autoencoder
Sticking with the MNIST dataset, let's improve our autoencoder's performance using convolutional layers. We'll build a convolutional autoencoder to compress the MNIST dataset.
>The encoder portion will be made of convolutional and pooling layers and the decoder will be made of **transpose... | github_jupyter |
```
import os
import shutil
from collections import OrderedDict
from copy import deepcopy
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import scipy.io
import numpy as np
from numpy import exp,arange
from pylab import meshgrid,cm,imshow,contour,clabel,colorbar,axis,title,show
from ... | github_jupyter |
# Семинар 7 - Классификация методами машинного обучения
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.simplefilter('ignore')
plt.style.use('seaborn')
%matplotlib inline
```
# Логистическая регрессия
## Краткая теория
 of seq2seq NMT in PyTorch.*
We are going to implement the mod... | github_jupyter |
# USAD
## Environment
```
!rm -r sample_data
!git clone https://github.com/manigalati/usad
%cd usad
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import torch
import torch.nn as nn
from utils import *
from usad import *
!nvidia-smi -L
device = get_default_device()
```
... | github_jupyter |
# Comparing the performance of optimizers
```
import pennylane as qml
import numpy as np
from qiskit import IBMQ
import itertools
import matplotlib.pyplot as plt
import pickle
import scipy
```
## Hardware-friendly circuit
```
n_wires = 5
n_shots_list = [10, 100, 1000]
devs = [qml.device("default.qubit", wires=n_wire... | github_jupyter |
# 1. Hidden Markov Models Introduction
This post is going to cover **hidden markov models**, which are used for modeling sequences of data. Sequences appear everywhere, from stock prices, to language, credit scoring, webpage visits.
Often, we may be dealing with sequences in machine learning and we don't even realize ... | github_jupyter |
```
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
import numpy as np
%matplotlib inline
from qiskit import Aer
from qiskit import execute
from qiskit.tools.visualization import matplotlib_circuit_drawer as drawer
from qiskit import IBMQ
from qiskit import compile
from qiskit.tools.visualization ... | github_jupyter |
# COVID-19 correlated variables of Mexican States
This Notebook downloads Geopandas GeoDataFrames for States (admin1) derived from the 2020 Mexican Census: [INEGI](https://www.inegi.org.mx/temas/mg/).
For details how these dataframe was created, see the [mexican-boundaries](https://github.com/sbl-sdsc/mexico-boundari... | github_jupyter |
# VQEによる量子化学計算
このチュートリアルでは、Amazon Braket で PennyLane を使用して量子化学の重要な問題、すなわち分子の基底状態エネルギーを見つける方法を説明します。この問題は、変分量子固有値ソルバー (VQE) アルゴリズムを実装することにより、近項量子ハードウェアを使用して対処できます。量子化学とVQEの詳細については、[Braket VQE ノートブック](../Hybrid_quantum_algorithms/vqe_Chemistry/vqe_Chemistry_braket.ipynb) や [PennyLane チュートリアル](https://pennylane.ai/qml/de... | github_jupyter |
```
import logging
from conf import LisaLogging
LisaLogging.setup()
# Generate plots inline
%matplotlib inline
import os
```
# Target Connectivity
## Board specific settings
Boards specific settings can be collected into a JSON
platform description file:
```
!ls -la $LISA_HOME/libs/utils/platforms/
!cat $LISA_HOM... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use("fivethirtyeight")
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
data=pd.read_csv("data.txt",sep=",")
data.head()
data.describe().transpose()
data.isnull().sum()
data.count()
data[... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
import intake,yaml
import intake_esm
from scipy import special
import keras
from keras.models import Model
from keras.layers import Dense, Input
def latest_version(cat):
"""
input
cat: esmdatastore
output
... | github_jupyter |
```
n=5
s='*'
for i in range(n):
print(s)
s = s+'*'
n = 5
for i in range(n+1):
print("*"*i)
n = 5
for i in range(n+1):
print(" "*(n-i), "*"*i)
n = 10
for i in range(n+1):
if i%2 == 1:
print(" "*int((n-i)/2), "*"*i)
```
두 정수 a, b가 주어졌을 때 a와 b 사이에 속한 모든 정수의 합을 리턴하는 함수, solution을 완성하세요.
예를 들어 ... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# Inferencing with TensorFlow 2.0 on Azure Machine Learning Service
## Overview of Workshop
This notebook is Part 2 (Inferencing and Deploying a Model) of a four part workshop that demonstrates an end-to-end workflow for imple... | github_jupyter |
<h1>Block file parser</h1>
<h2>Structure of Block</h2>
<p>
Block contains pre-header, header and transactions list.<br>
Block header hash must meet difficulty criteria which can be calculated from "Bits" in block header. This is achieved by setting "Nounce" in block header.<br>
For fields where bytes of value is [1-9 ... | github_jupyter |
[Table of Contents](./table_of_contents.ipynb)
# The Extended Kalman Filter
```
#format the book
%matplotlib inline
from __future__ import division, print_function
from book_format import load_style
load_style()
```
We have developed the theory for the linear Kalman filter. Then, in the last two chapters we broached... | github_jupyter |
# Functions (Magic spell boxes)
Functions are magic spell boxes, which store their own sleeping princesses and incantations.\
You can cast the spell with ()\
Casting the spell with () creates it own sub realm, which disappers after the sub realm returns an object to the main realm at the end of the spell\
The sleeping... | github_jupyter |
# DrugNorm
author -- AR Dirkson --
date -- 08-02-2019 --
python version -- 3 --
This script first subsets the dictionary for the drug names that are in your corpus and then uses simple matching to replace them by the generic drug name chosen as a key in the dictionary.
The CELEX_lwrd_unique is a list of all the... | github_jupyter |
<center><img src="http://alacip.org/wp-content/uploads/2014/03/logoEscalacip1.png" width="500"></center>
<center> <h1>Curso: Introducción al Python</h1> </center>
<br></br>
* Profesor: <a href="http://www.pucp.edu.pe/profesor/jose-manuel-magallanes/" target="_blank">Dr. José Manuel Magallanes, PhD</a> ([jmagallane... | github_jupyter |
```
import numpy as np
import sys
import os
import copy
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.patches as mpatches
from matplotlib.collections import PatchCollection
from abc import ABC, abstractmethod
import math
import copy
from copy import deepcopy
import PIL
from skim... | github_jupyter |
## Manual publication DB insertion from raw text using syntax features
### Publications and conferences of Dr. POP F. Horia, Profesor Universitar
#### http://www.cs.ubbcluj.ro/~hfpop
#### Text copied from professor's dynamic webpage.
```
text = """
Principal component analysis versus fuzzy principal component analysi... | github_jupyter |
# Overview
This notebook contains all experiment results exhibited in our paper.
```
%matplotlib inline
import glob
import numpy as np
import pandas as pd
import json
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib
sns.set(style='white')
matplotlib.rcPara... | github_jupyter |
```
%matplotlib inline
```
# K-means Clustering
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initialization is on the classification process:
By setting n_init to only 1 (default is 10), the amount of
times that the algorithm will be ... | github_jupyter |
# Python cheatsheet
Inspired by [A Whirlwind Tour of Python](https://jakevdp.github.io/WhirlwindTourOfPython/) and [another Python Cheatsheet](https://www.pythoncheatsheet.org/).
Only covers Python 3.
```
import this
```
## Basics
```
# Print statement
print("Hello World!") # Python 3 - No parentheses in Python 2... | github_jupyter |
## Dependencies
```
import glob
import numpy as np
import pandas as pd
from transformers import TFBertModel
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Input, Dropout, GlobalAveragePooling1D, GlobalMaxPooling1D, concatenate
# Datasets
def get_test_datase... | github_jupyter |
# PETs/TETs – Hyperledger Aries – Authority Agent (Issuing Authority) 🏛️
```
%%javascript
document.title='🏛️ Authority'
```
## PART 2: Issue a VC to the Manufacturer Agents
**What:** Issue verifiable credentials (VCs) to all manufacturers
**Why:** Manufacturers will be able to store VCs, and prove to the city (th... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
```
This line is only for jupyter notebooks, for another editor, simply we use: **plt.show()** at the end of all your plotting commands to have the figure pop up in another window.
### Basic plot
```
x = np.arange(1,10)
y =... | github_jupyter |
```
from fastai.vision import *
DATA = untar_data(URLs.IMAGENETTE_160)
src = (ImageList.from_folder(DATA).filter_by_rand(0.3, seed=42)
.split_by_folder(valid='val')
.label_from_folder()
.transform(([flip_lr(p=0.5)], []), size=160))
data = (src.databunch(bs=64, num_workers... | github_jupyter |
# Badge Holder Tests
The purpose of these tests was to determine if badges in antistatic / non-antistatic holders behave differently.
Our initial hypothesis is that the antistatic holders were obstructing the bluetooth signal due to the slight conductivitiy of antistatic surfaces. Therefore we expect to see more issue... | github_jupyter |
# First a little bit of statistics review:
# Variance
Variance is a measure of the spread of numbers in a dataset. Variance is the average of the squared differences from the mean. So naturally, you can't find the variance of something unless you calculate it's mean first. Lets get some data and find its variance.
`... | github_jupyter |
<a href="https://colab.research.google.com/github/arunraja-hub/Preference_Extraction/blob/master/export_lucid.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Install and imports
```
%tensorflow_version 1.x
!pip uninstall lucid -y
!pip install git... | github_jupyter |
```
#@title Copyright 2020 Google LLC. Double-click here for license information.
# 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 requ... | github_jupyter |
```
import numpy as np
from collections import Counter
class Mission:
def __init__(self, missionTitle, game_size, difficulty_modifier):
self.event_list = ["A pressurized line has ruptured",
"An air lock has broken",
"Electrical lines are damaged",
... | github_jupyter |
## Wavelets
An increasingly popular family of basis functions is called **wavelets**. By construction, wavelets are localized in both frequency and time domains. Individual wavelets are specified by a set of wavelet filter coefficients. Given a wavelet, a complete
orthonormal set of basis functions can be constructed ... | github_jupyter |
# Generative Adversarial Network in Tensorflow
**Generative Adversarial Networks**, introduced by Ian Goodfellow in 2014, are neural nets we can train to _produce_ new images (or other kinds of data) that look as though they came from our true data distribution. In this notebook, we'll implement a small GAN for genera... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import torch
device = 'cuda' if torch.cuda.is_available() else 'cpu'
from copy import deepcopy
import pickle as pkl
from ex_cosmology import p
from matplotlib import gridspec
import matplotlib.patches as mpatc... | github_jupyter |
## Outlier Engineering
An outlier is a data point which is significantly different from the remaining data. “An outlier is an observation which deviates so much from the other observations as to arouse suspicions that it was generated by a different mechanism.” [D. Hawkins. Identification of Outliers, Chapman and Hal... | github_jupyter |
# Implementing Shazam from scratch
Shazam is a great application that can tell you the title of a song by listening to a short sample. We will implement a simplified copy of this app by dealing with hashing algorithms. In particular implementing an LSH algorithm that takes as input an audio track and finds relevant mat... | github_jupyter |
# Case Study: Stock Charts
```
import pandas as pd
import numpy as np
import datetime
import matplotlib.pyplot as plt
%matplotlib inline
pd.set_option('display.notebook_repr_html', False)
pd.set_option('precision', 3)
pd.set_option('display.max_rows', 8)
pd.set_option('display.max_columns', 15)
```
References:
https:... | github_jupyter |
# IFRS17 Simulation (Lapse Scenario)
If you're viewing this page as a static HTML page on https://lifelib.io, the same contents are also available [here on binder] as Jupyter notebook executable online (it may take a while to load)
To run this notebook and get all the outputs below, Go to the **Cell** menu above, and... | github_jupyter |
# Simple Toy Problem
This notebook contains a simple artificial experiment setup to illustrate optimal control.
```
%load_ext autoreload
%autoreload 2
%config IPCompleter.greedy=True
# Importing relevant libraries
import cvxpy as cp
import numpy as np
from solara.constants import PROJECT_PATH
EXPERIMENT_NAME = "exper... | github_jupyter |
# Scale Seldon Deployments based on Prometheus Metrics.
This notebook shows how you can scale Seldon Deployments based on Prometheus metrics via KEDA.
[KEDA](https://keda.sh/) is a Kubernetes-based Event Driven Autoscaler. With KEDA, you can drive the scaling of any container in Kubernetes based on the number of eve... | github_jupyter |
# NASBench-101
This colab accompanies [**NAS-Bench-101: Towards Reproducible Neural Architecture Search**](https://arxiv.org/abs/1902.09635) and the rest of the code at https://github.com/google-research/nasbench.
In this colab, we demonstrate how to use the dataset for simple benchmarking and analysis. The publicly ... | github_jupyter |
# Experiment 5.1 - Features extracted using Inception Resnet v2 + SVM
Reproduce Results of [Transfer learning with deep convolutional neural network for liver steatosis assessment in ultrasound images](https://pubmed.ncbi.nlm.nih.gov/30094778/). We used a pre-trained CNN to extract features based on B-mode images.
... | github_jupyter |
```
# Copyright 2020 IITK EE604A Image Processing. All Rights Reserved.
#
# Licensed under the MIT License. Use and/or modification of this code outside of EE604 must reference:
#
# © IITK EE604A Image Processing
# https://github.com/ee604/ee604_assignments
#
# Author: Shashi Kant Gupta, Cheeranjeev and Prof K. S. Ve... | github_jupyter |
# Pandas
Os exemplos abaixo foram tirados do artigo a seguir: https://towardsdatascience.com/pandas-from-basic-to-advanced-for-data-scientists-aee4eed19cfe
Pandas é a biblioteca python mais comumente usada para manipulação e análise de dados.
## Importando o Pandas
Vamos importar o pandas. Costumamos chamá-lo de pd... | github_jupyter |
```
! pip install -U pip
! pip install -U torch==1.5.0
! pip install -U torchtext==0.6.0
! pip install -U matplotlib==3.2.1
! pip install -U clearml>=0.15.0
! pip install -U tensorboard==2.2.1
import os
import time
import torch
import torch.nn as nn
from torchtext.datasets import text_classification
from torch.utils.t... | github_jupyter |
# Bite Size Bayes
Copyright 2020 Allen B. Downey
License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
## The "Girl Named Florida" problem
In [The Drunkar... | github_jupyter |
```
%pylab inline
rcParams["figure.figsize"] = (16,5)
import sys
sys.path.insert(0, "..")
!pip3 install pysptk
!pip3 install pyworld
import torch
from scipy.io import wavfile
import pysptk
from pysptk.synthesis import Synthesizer, MLSADF
import pyworld
from os.path import join, basename
#from nnmnkwii import preproc... | github_jupyter |
<a href="https://colab.research.google.com/github/mengwangk/dl-projects/blob/master/04_02_auto_ml_4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Automated ML
```
COLAB = True
if COLAB:
!sudo apt-get install git-lfs && git lfs install
!rm -... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.