text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
##### © Copyright 2020 [George Mihaila](https://github.com/gmihaila).
Licensed under the Apache License, Version 2.0 (the "License");
```
#@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... | github_jupyter |
# For Exploring Changes Over Time
```
import pandas as pd
import numpy as np
import nltk
import sklearn
import string, re
import urllib
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.preprocessing import OneHotEncoder,StandardScaler
from sklearn.feature_extraction.text import TfidfVect... | github_jupyter |
```
%matplotlib inline
```
Fusing Convolution and Batch Norm using Custom Function
=======================================================
Fusing adjacent convolution and batch norm layers together is typically an
inference-time optimization to improve run-time. It is usually achieved
by eliminating the batch norm l... | github_jupyter |
Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks.
- Author: Sebastian Raschka
- GitHub Repository: https://github.com/rasbt/deeplearning-models
```
%load_ext watermark
%watermark -a 'Sebastian Raschka' -v -p torch
```
- Runs ... | github_jupyter |
<table align="left" width="100%"> <tr>
<td style="background-color:#ffffff;">
<a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="35%" align="left"> </a></td>
<td style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
prepared... | github_jupyter |
```
import time
import keras
import numpy as np
from keras import backend as K
from keras.datasets import mnist
from keras.models import Model, load_model
import cv2
import matplotlib.pyplot as plt
import pynq.lib.dma
from pynq import MMIO, PL, DefaultHierarchy, Overlay, Xlnk
class Convolutional_Neural_Network(Defaul... | github_jupyter |
# TextAttack on Keras Model
[](https://colab.research.google.com/github/QData/TextAttack/blob/master/docs/2notebook/Example_6_Keras.ipynb)
[](https://github.co... | github_jupyter |
# 2 - Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation
In this second notebook on sequence-to-sequence models using PyTorch and TorchText, we'll be implementing the model from [Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation](ht... | github_jupyter |
## Word2vec
In this notebook, we will introduce word 2 vect algorithm
## Readings
Here are the resources I used to build this notebook. I suggest reading these either beforehand or while you're working on this material.
* A really good [conceptual overview](http://mccormickml.com/2016/04/19/word2vec-tutorial-the-sk... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from sos4hjb.polynomials import Variable, MonomialVector, ChebyshevVector, Polynomial
from sos4hjb.optimization.cvx import SosProgram
from sos4hjb.plot_utils import level_plot
```
# System dynamics
```
# State with limits.
x = Variable.multivariate('x', 2)
xlim =... | github_jupyter |
# Kernel hypothesis testing in Shogun
#### Heiko Strathmann - [heiko.strathmann@gmail.com](mailto:heiko.strathmann@gmail.com) - http://github.com/karlnapf - http://herrstrathmann.de
#### Soumyajit De - [soumyajitde.cse@gmail.com](mailto:soumyajitde.cse@gmail.com) - http://github.com/lambday
This notebook describes Sh... | github_jupyter |
# Manipulate data the MXNet way with `ndarray`
It's impossible to get anything done if we can't manipulate data.
Generally, there are two important things we need to do with:
(i) acquire it! and (ii) process it once it's inside the computer.
There's no point in trying to acquire data if we don't even know how to sto... | github_jupyter |
# Object Detection
# Imports
```
import sys
sys.path.append("../app")
import numpy as np
import os
import six.moves.urllib as urllib
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
from objec... | github_jupyter |
# Signal convolutions
Time invariant filter in the previous notebook assumes that the filter coefficients are stored as the weight of the 1D convolution layer. However, when we wish to predict the filter coefficients from another network, we need to use a different API that receives the filter coefficients as input ra... | github_jupyter |
# Face Recognition for the Happy House
Welcome to the first assignment of week 4! Here you will build a face recognition system. Many of the ideas presented here are from [FaceNet](https://arxiv.org/pdf/1503.03832.pdf). In lecture, we also talked about [DeepFace](https://research.fb.com/wp-content/uploads/2016/11/deep... | github_jupyter |

# Deep Learning
Vamos utilizar o tutorial do TensorFlow: [MNIST For ML Beginners](https://www.tensorflow.org/get_started/mnist/beginners)<br>
com algumas modificações
```
# interatividade
from ipywidgets import interact, interactive, fixed, interact_manual, FloatSlider, IntSlider
import ipy... | github_jupyter |
```
# !pip install timm torch_snippets sklego typer
import torch
import onnx
import torch
import torchvision
import sys
sys.path.append("../../horse_zebra_onnx/")
# from auto_train.infer_classification import ImageClassifier
m = ImageClassifier()
# im = torch.ones((1,3,224,224), dtype=torch.float32).cuda() ## todevice... | github_jupyter |
<span style="float:right"><a href="http://moldesign.bionano.autodesk.com/" target="_blank" title="About">About</a> <a href="https://github.com/autodesk/molecular-design-toolkit/issues" target="_blank" title="Issues">Issues</a> <a href="http://bionano... | github_jupyter |
```
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.utils import shuffle
import sklearn
import os
%matplotlib inline
from tensorflow.keras import Sequential
import tensorflow as tf
import tensorflow.keras.layers
from tensorflow.keras.layers import Bidirectional, LSTM, Dense
import te... | github_jupyter |
```
from pathlib import Path
from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Arial']
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pyprojroot
import seaborn as sns
import searchnets
def cm_to_inches(cm):
... | github_jupyter |
```
ls /home/jovyan/bin
%alias_magic solidity script -p "/home/jovyan/.solcx/solc-v0.6.7 --ast-json -"
%alias_magic ape script -p "/home/jovyan/bin/ape.bin -csyntax"
%alias_magic lexonv3 script -p "/home/jovyan/bin/lexon"
%alias_magic lexonv2 script -p "/home/jovyan/bin/lexon-rust <"
```
### Todo
* check with phd-data... | github_jupyter |
```
# Setup if running in colab
RunningInCOLAB = 'google.colab' in str(get_ipython())
if RunningInCOLAB:
try:
if runonce:
print("Already ran")
except:
runonce = True
!pip install wandb
!git clone https://github.com/Jimmy-Nnilsson/StudieGrupp3_MLProjekt.git
import wandb
wandb.lo... | github_jupyter |
# Setup
```
remote = False
from google.colab import files
files.upload() # Upload your kaggle.json here.
from google.colab import drive
drive.mount('/content/gdrive')
# In the scenario where we work away from laptop.
import shutil
gdrive_kggle_json_path = r"/content/gdrive/MyDrive/Kaggle Competitions/kaggle.json"
... | github_jupyter |
```
# Import the pandas library for managing data
#
import pandas as pd
# Set the notebook so that it can display all countries in a dataframe
#
pd.set_option('display.max_rows', 200)
# Define variables for reading in the data worksheet from the World Bank's Doing Business website
#
data_url = 'http://www.doingbusines... | github_jupyter |
# Deep Neural Network for Image Classification: Application
When you finish this, you will have finished the last programming assignment of Week 4, and also the last programming assignment of this course!
You will use use the functions you'd implemented in the previous assignment to build a deep network, and apply i... | github_jupyter |
### Dependencies
```
# Dependencies
import os
import cv2
import math
import random
import shutil
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
from skimage import exposure
import multiprocessing as mp
import albumentations as albu
import matplotlib.pyplot as plt
from tensorflow import se... | github_jupyter |
```
import swat
import pandas as pd
```
# Server setup
(requires user-specific parameters)
```
s = swat.CAS(host, port, username, password)
s.table.addCaslib(caslib="ba_200", dataSource={"srcType":"path"}, path="/path/to/ba_u_10_15_200_0/csv/data")
s.table.addCaslib(caslib="ba_400", dataSource={"srcType":"path"}, pat... | github_jupyter |
# Live demo at EuroPython 2018
Goals
* Take live survey data from the audience about Ada's weight
* Provide descriptive statistics
* Graph the two surveys
* See if the sample variance changes when more information is provided
```
import os
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import... | github_jupyter |
# Link prediction example: GraphSAGE on GOV.UK data
```
import networkx as nx
import pandas as pd
import os
import stellargraph as sg
from stellargraph.data import EdgeSplitter
from stellargraph.mapper import GraphSAGELinkGenerator
from stellargraph.layer import GraphSAGE, link_classification, \
... | github_jupyter |
# Farm Simulator
There is a hypothetical farm simulator game that is played on a social media network.
In the game you can grow, plant, and harvest different crops.
While the game is free to play, users are able to make transactions in the game which assist them and their farm in different ways.
The developers want t... | github_jupyter |
# Sentiment Analysis
- Use summarized S-1 raw filings
- Add Sentimnet Analysis features
- Tokenize sentences
- Use positive and negative sentences
```
#core
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import glob
import nasdaq
import ml
from pathlib import Path
#NLP
from nltk.tokenize i... | github_jupyter |
# Extend ITK with your own module - Part 2
## Creation of a remote module: Overview
1. The developer creates a new module containing new ITK filters.
* The new module is its own independent GitHub project.
* The new module can be easily be compiled and used in combination with ITK.
2. The developer writes an ... | github_jupyter |
```
import json
from pathlib import Path
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
```
## Configuration
```
SIZE = 96
CODENAME = f'f{SIZE}-s{SIZE}-m0'
EXPERIMENT_NAME = f'densenet121-{CODENAME}'
SHARD = 'amy'
TRAIN_TEST_SPLIT = 0.8
BATCH_SIZE = 128
EPOCHS = 50
LR = 0.001
SLIDES... | github_jupyter |
<p align="center">
<img src="https://github.com/GeostatsGuy/GeostatsPy/blob/master/TCG_color_logo.png?raw=true" width="220" height="240" />
</p>
## Uncertaint Model Checking Demonstration
### Michael Pyrcz, Associate Professor, University of Texas at Austin
##### [Twitter](https://twitter.com/geostatsguy) | ... | github_jupyter |
## NBA Career Prediction Experiment
```
experiment_label = 'xgb02a_repeat'
```
### Aim:
* To improve on xgb01, by using imblearn
* To improve on 0.71259 on Kaggle.
### Findings:
Retain -ve values, apply SMOTE & under sampling pipeline, search on roc_auc.
Results train, val auc:
* (02a) SMOTE, under = 0.50, 0.75 : 0... | github_jupyter |
# Unit 5 - Financial Planning
```
# Initial imports
import os
import requests
import pandas as pd
from dotenv import load_dotenv
import alpaca_trade_api as tradeapi
from MCForecastTools import MCSimulation
%matplotlib inline
# Load .env enviroment variables
load_dotenv()
```
## Part 1 - Personal Finance Planner
###... | github_jupyter |
# No-show appointment Analysis
## Here's the Dataset <a href="https://www.kaggle.com/joniarroba/noshowappointments">Link</a>
### Table of Contents
<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#wrangling">Data Wrangling</a></li>
<li><a href="#eda">Exploratory Data Analysis</a></li>
<li><a href="#conclu... | github_jupyter |
# 1. Import libraries
```
#----------------------------Reproducible----------------------------------------------------------------------------------------
import numpy as np
import tensorflow as tf
import random as rn
import os
seed=0
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
rn.seed(seed)
#sess... | github_jupyter |
```
from glob import glob
excel_files = glob('data/excel/*.xlsx')
excel_files
import pandas as pd
df = pd.read_excel(excel_files[0], sheet_name='MISO', skiprows=4, nrows=17, index_col=0, usecols=range(7))
df
loads = df.loc['Projected Load', :].to_list()
loads
wind = df.loc['Renewable Forecast', :].to_list()
wind
load_l... | github_jupyter |
```
import os
import numpy as np
import itertools
import pathos
from pathos.multiprocessing import ProcessingPool as Pool
import matplotlib.pyplot as plt
%matplotlib inline
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import MetaData, Co... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
Licensed under the Apache License, Version 2.0 (the "License").
# Image Captioning with Attention
<table class="tfo-notebook-buttons" align="left"><td>
<a target="_blank" href="https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/... | github_jupyter |
You might need to install this on your system:
apt-get install python3-opencv git
```
import os
#"""
# ! rm -r k
if not os.path.isdir('k'):
!git clone -b development12 https://github.com/joaopauloschuler/k-neural-api.git k
else:
!cd k && git pull
#"""
!cd k && pip install .
import cai.layers
import cai.datasets
imp... | github_jupyter |
# Using QAOA to solve a MIS problem
```
import numpy as np
import igraph
from itertools import combinations
import matplotlib.pyplot as plt
from pulser import Pulse, Sequence, Register
from pulser.simulation import Simulation
from pulser.devices import Chadoq2
from scipy.optimize import minimize
```
## 1. Introduc... | github_jupyter |
# Librerías: Pandas
https://pandas.pydata.org/
El contenido de este tutorial está basado y fue adaptado del curso de pandas de Kaggle disponible en https://www.kaggle.com/learn/pandas
mismo que tiene licencia open source Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0
### En esta parte vamos a aprender cómo... | github_jupyter |
Greetings to all Kagglers!!!
This is my first kernel. I was inspired by other Kagglers who make awesome kernels for begineers like me so that we can learn a lot. Yes, I have learnt a lot just by going thorugh the public kernels in this competitions.
In this kernel I want to initegrate the main ideas/tricks presented ... | github_jupyter |
```
# default_exp utils
```
# Utils
> This module offers useful utilities.
```
#hide
#skip
from nbverbose.showdoc import *
#export
import os
import ast
import wandb
import numpy as np
import pandas as pd
from tqdm import tqdm
from pathlib import Path
# from fastcore.xtras import globtastic
# pydicom r... | github_jupyter |
<a href="https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/32_supervised_classification.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/></a>
Uncomment the following line to install [geemap](https://geemap.org) if needed.
```
# !pip ... | github_jupyter |
```
# End-End training and testing of the new pytorch-based VGG16-deeplabv3 architecture
# https://stackoverflow.com/questions/37893755/tensorflow-set-cuda-visible-devices-within-jupyter
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="1"
# https://stackover... | github_jupyter |
# Essentially same as otbn_find_bits.ipynb but streamlined for 25M captures.
```
import numpy as np
#waves = np.load('waves_p256_streamed.npy')
#waves = np.load('waves_p256_streamed_half1half0.npy')
#waves = np.load('waves_p256_streamed_patterned.npy')
waves = np.load('waves_p256_streamed_32bitblocks.npy')
#wave = np.... | github_jupyter |
<p align="center">
<img src="https://github.com/GeostatsGuy/GeostatsPy/blob/master/TCG_color_logo.png?raw=true" width="220" height="240" />
</p>
# Data Science Basics in Python Series
## Chapter III: Matplotlib for Univariate Data Visualization in Python
### Michael Pyrcz, Associate Professor, The University o... | github_jupyter |
# Demo Wine - Exploration données
Dataset https://archive.ics.uci.edu/ml/datasets/Wine+Quality
### Attribute Information:
```
Input variables (based on physicochemical tests):
1 - fixed acidity
2 - volatile acidity
3 - citric acid
4 - residual sugar
5 - chlorides
6 - free sulfur dioxide
7 - total sulfur dioxide
8 - ... | github_jupyter |
```
from datetime import timedelta
from time import localtime, strftime, time
import matplotlib as mpt
import numpy as np
import pandas as pd
import scipy.spatial
from IPython.display import HTML, display
from matplotlib import pyplot as plt
import libsvm.python.svm as svm
import libsvm.python.svmutil as svmutil
# ut... | github_jupyter |
```
import pandas as pd
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import matplotlib as mpl
from IPython.display import Image, display
## NWS Station Data
filename_pattern = '../data/NWS_precip/station_data/'
df_KVBG = pd.read_csv(filename_pattern + 'KVBG.csv', header=6, skiprows=[7], sep=',... | github_jupyter |
```
%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) { return false; }
// disable scrollable cells
```
# PyTorch FashionMNIST, MNIST, CIFAR 10
```
# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514
import tensorflow as tf
import numpy as np
import scipy.mi... | github_jupyter |
# Quantizing Neural Machine Translation Models
We continue our quest to quantize every Neural Network!
On this chapter: __Google's Neural Machine Translation model__.
A brief summary - using stacked LSTMs and attention mechanism, this model encodes a sentence into a list of vectors and then decodes it to the other... | github_jupyter |
# Pandas:
## the primary Python tabular data analysis/manipulation toolkit
####Presented by Michael Ripperger
### What is Pandas?
* Python package
* Functional toolkit
* Organizes data
* Manipulates data
* Analyzes data
```
import pandas as pd
import numpy as np
```
##Speed!
* Built upo... | github_jupyter |
# NumPy Basics: Arrays and Vectorized Computation
```
%matplotlib inline
from __future__ import division
from numpy.random import randn
import numpy as np
np.set_printoptions(precision=4, suppress=True)
```
## The NumPy ndarray: a multidimensional array object
```
data = randn(2, 3)
data
data * 10
data + data
data.s... | github_jupyter |
# Collaboration and Competition
---
You are welcome to use this coding environment to train your agent for the project. Follow the instructions below to get started!
### 1. Start the Environment
Run the next code cell to install a few packages. This line will take a few minutes to run!
```
!pip install numpy>=1.... | github_jupyter |
# LSTMs for Human Activity Recognition</a>
Human Activity Recognition (HAR) using smartphones dataset and an LSTM RNN. Classifying the type of movement amongst six categories:
- WALKING,
- WALKING_UPSTAIRS,
- WALKING_DOWNSTAIRS,
- SITTING,
- STANDING,
- LAYING.
Compared to a classical approach, using a Recurrent Neu... | github_jupyter |
```
import time
time.sleep(60*10)
#!pip install tensorflow==1.14.0
#!pip install keras==2.2.5
import os
os.environ["PYTHONHASHSEED"] = "13"
os.environ["CUDA_VISIBLE_DEVICES"] = "0:1"
import numpy as np
import tensorflow as tf
import random as rn
# The below is necessary for starting Numpy generated random numbers
# i... | github_jupyter |
# FloPy
## Creating a Complex MODFLOW 6 Model with Flopy
The purpose of this notebook is to demonstrate the Flopy capabilities for building a more complex MODFLOW 6 model from scratch. This notebook will demonstrate the capabilities by replicating the advgw_tidal model that is distributed with MODFLOW 6.
### Setup ... | github_jupyter |
```
# Import the standard libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
# Importing our training and test dataset as dataframes
train=pd.read_csv('C:\\Users\\Aayush Kandpal\\Downloads\\train.csv... | github_jupyter |
# Training the RPN signature on multi-center data
- This jupyter notebook is available on-line at:
- https://github.com/spisakt/RPN-signature/blob/master/notebooks/1_multi-center_training.ipynb
- Input data for the notebook and non-standard code (PAINTeR library) is available in the repo:
- https://github.com/spi... | github_jupyter |
<a href="https://colab.research.google.com/github/beangoben/deep_learning_escuela_verano_19/blob/master/notebooks/1c_densa.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Red neuronal densa
Una red neuronal está compuesta por una capa de entrada, ... | github_jupyter |
# What is a PDF?
[](https://github.com/eabarnes1010/course_objective_analysis/tree/main/code)
[](https://colab.research.google.com/github/eabarnes1010/course_objective_analy... | github_jupyter |
## Counting Colonies with scikit-image
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.color import rgb2gray
from skimage.draw import circle
```
### Load in the plate image
```
image = np.array(Imag... | github_jupyter |
```
%run -i ../python/common.py
```
# Organizing and Managing Information as a Tree of Files and Directories
Before we get our hands dirty there are a few "ideas" that are worth understanding in order to make our UNIX adventure a little easier.
## Information Management
<img align="right" width="400" src="../images... | github_jupyter |
```
from lolviz import *
class Node:
def __init__(self, value):
self.value = value
self.edges = [] # outgoing edges
def add(self, target):
self.edges.append(target)
def __repr__(self): return str(self.value)
sf = Node("SF")
la = Node("LA")
sac = Node("Sacramento")
oak = Node("Oakland")
baker = Node("B... | github_jupyter |
# Counts Analysis with Cognitive Associations
Co-occurence of terms analysis: check how often pre-selected cognitive terms appear in abstracts with ERP terms.
This analysis searches through pubmed for papers that contain specified ERP and selected association terms.
Data extracted is the count of the number of pape... | github_jupyter |
<a href="https://colab.research.google.com/github/agemagician/CodeTrans/blob/main/prediction/single%20task/function%20documentation%20generation/go/small_model.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
**<h3>Predict the documentation for go co... | github_jupyter |
# Neural Machine Translation
Welcome to your first programming assignment for this week!
You will build a Neural Machine Translation (NMT) model to translate human readable dates ("25th of June, 2009") into machine readable dates ("2009-06-25"). You will do this using an attention model, one of the most sophisticate... | github_jupyter |
# hardware and OS
To run this repo, you need 1 to 8 GPUs with CUDA. If you don't have a Nvidia Graphic card, no problem! This notebook is intended to run on Google Colab!
Don't forget to activate the GPU in **Goolgle Colab** ([how to](https://jovianlin.io/pytorch-with-gpu-in-google-colab/)) If you do not enable GPU fr... | github_jupyter |
# Comparison of Batch, Mini-Batch and Stochastic Gradient Descent
This notebook displays an animation comparing Batch, Mini-Batch and Stochastic Gradient Descent (introduced in Chapter 4). Thanks to [Daniel Ingram](https://github.com/daniel-s-ingram) who contributed this notebook.
```
import numpy as np
%matplotlib ... | github_jupyter |
```
#For documentation on using this program refer to: https://github.com/RohanPankaj/NBA-Prediction/blob/master/docs/Team-Prediction.md
#imports
import pandas as pd
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import time
import matplotlib.pyplot as pl... | github_jupyter |
```
import pennylane as qml
from pennylane import numpy as np
from pennylane.optimize import AdamOptimizer
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import style
style.use('bmh')
style.use('dark_background')
```
## Loading tha manipulation of data
```
data = np.asanyarray(pd.read_csv('./Lab... | github_jupyter |
```
# importando tudo que a gente precisa importar
import librosa
import librosa.display
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import IPython.display as ipd
# ajustando nossos plots
plt.rcParams['figure.figsize'] = (15,5)
```
# Representações
## representações no... | github_jupyter |
```
import numpy as np
import pandas as pd
import torch
from gluonts.dataset.multivariate_grouper import MultivariateGrouper
from gluonts.dataset.repository.datasets import dataset_recipes, get_dataset
from pts.model.tempflow import TempFlowEstimator
from pts.model.transformer_tempflow import TransformerTempFlowEstima... | github_jupyter |
# Modified Triplet Loss : Ungraded Lecture Notebook
In this notebook you'll see how to calculate the full triplet loss, step by step, including the mean negative and the closest negative. You'll also calculate the matrix of similarity scores.
## Background
This is the original triplet loss function:
$\mathcal{L_\mat... | github_jupyter |
# Academy of Py
<b> Problem Statement </b>
Well done! Having spent years analyzing financial records for big banks, you've finally scratched your idealistic itch and joined the education sector. In your latest role, you've become the Chief Data Scientist for your city's school district. In this capacity, you'll be he... | github_jupyter |
# Quickstart: Use Cases and Examples with *Interpretable OPE Evaluator*
This notebook demonstrates an example of conducting Interpretable Evaluation for Off-Policy Evaluation (IEOE). We use logged bandit feedback data generated by modifying multiclass classification data using [`obp`](https://github.com/st-tech/zr-obp... | github_jupyter |
## Introduction
This notebook accompanies the paper "Impact of non-parabolic electronic band structure on the optical, defect, and transport properties of photovoltaic materials". It reproduces some of the key results from the paper and includes supplementary information. It makes extensive use of the [effmass](http:/... | github_jupyter |
```
# noexport
import os
os.system('export_notebook identify_domain_training_data_v2.ipynb')
from tmilib import *
import csv
import sys
num_prev_enabled = int(sys.argv[1])
num_labels_enabled = 2 + num_prev_enabled
data_version = 4+8 + num_prev_enabled
print 'num_prev_enabled', num_prev_enabled
print 'data_version', da... | github_jupyter |
# Modules in Pyro
This tutorial introduces [PyroModule](http://docs.pyro.ai/en/stable/nn.html#pyro.nn.module.PyroModule), Pyro's Bayesian extension of PyTorch's [nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) class. Before starting you should understand the basics of Pyro [models](http://pyro.ai/... | github_jupyter |
```
import os, sys, glob, pickle
import geopandas as gpd
import pandas as pd
import matplotlib.pyplot as plt
root='/home/lucas/repos/solar-pv-global-inventory'
match_files = glob.glob(os.path.join(root,'data','match_wri_*_4000_0.05*.gpkg'))
match_files += glob.glob(os.path.join(root,'data','match_eia*.gpkg'))
match_fil... | github_jupyter |
# 编制音乐索引
捕捉音乐风格,建立索引,实现音乐的搜索引擎,就可以用来听歌识曲了,类似于 Shazam。
```
import random
random.seed(42)
import numpy as np
np.random.seed(42)
import tensorflow as tf
tf.random.set_seed(42)
```
这里做了个简单的数据集,包含我随便选的 131 首歌:
```
DIR = "/Volumes/shared/murecom/intro/idx-local-mp3/"
def myfile(name):
return os.path.join(DIR, name... | github_jupyter |
<a href="https://colab.research.google.com/github/chavgova/My-AI/blob/master/emotion_recognition_20_female_160values_time.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
**Voice Emotion Recognition**
```
import librosa
import librosa.display
import... | github_jupyter |
The data from Maven here is from 01/01/2015 to 03/01/2015, at the beginning of the mission. This was the first attempt at filtering the data, without using the quality data from the SPDF website.
```
import numpy as np
import pandas as pd
import datetime
posFrame = pd.read_csv('csv files/MavenPosition2.csv')
windFrame... | github_jupyter |
```
import ibm_db
```
When the command above completes, the `ibm_db` library is loaded in your notebook.
## Task 2: Identify the database connection credentials
Connecting to dashDB or DB2 database requires the following information:
* Driver Name
* Database name
* Host DNS name or IP address
* Host port
* Conne... | github_jupyter |
# Run eQTL Analysis
This notebook coordinates and executes the eQTL analysis. This notebook is
specialized for the Frazer lab cluster. Since running the entire analysis is
time consuming, I generally run it "by hand," starting jobs for groups of
genes at different times. I've included instructions at various points b... | github_jupyter |
# Library
```
import os
from io import StringIO
import datetime
import pandas as pd
import psycopg2
from pprint import pprint
# version info
print('', 'Pandas version: ', pd.__version__, '\n', 'Psycopg 2 version:',
psycopg2.__version__)
```
# Connecting to PostgreSQL
```
# Connection params
dbname = "post... | github_jupyter |
# Prepare Developing Forebrain Bulk-seq (Demo)
# **All FASTQ files only contain 10000 reads form the source file downloaded below, so you can map it quickly for this demo**
## Aims of this notebook
1. prepare a clean metadata table, recording sample information for each FASTQ file
2. create soft-link to FASTQ files,... | github_jupyter |
```
from IPython.display import Markdown as md
### change to reflect your notebook
_nb_loc = "09_deploying/09c_changesig.ipynb"
_nb_title = "Changing signatures of exported model"
### no need to change any of this
_nb_safeloc = _nb_loc.replace('/', '%2F')
md("""
<table class="tfo-notebook-buttons" align="left">
<td... | github_jupyter |
# Language Exploration Using Vector Space Models
Natural language processing is a huge sub-field of artificial intelligence that deals with models and representations for natural language. A very common way to represent words, phrases, and documents in modern NLP involves the use of sparse vectors. Here we'll explor... | github_jupyter |
# Probabilistic Bayesian Neural Networks
**Author:** [Khalid Salama](https://www.linkedin.com/in/khalid-salama-24403144/)<br>
**Date created:** 2021/01/15<br>
**Last modified:** 2021/01/15<br>
**Description:** Building probabilistic Bayesian neural network models with TensorFlow Probability.
## Introduction
Taking a... | github_jupyter |
# Dataset Generation
Here we will generate 2 batches of datasets for our multi-class classification experiments.
First we produce our baseline datasets containing most of the features present in CIC_DDoS2019, and then we produce our time-based feature datasets, each containing only the 25 time-based features as well... | github_jupyter |
# Title
**Exercise 2 [Not Graded!] - Confusion Matrices & ROC Curves**
# Description
The aim of this exercise is to evaluate classification models through confusion matrics, ROC curves, and the AUC metric. You eventually will create a plot that looks like this:
<img src="../img/image2.png" style="width: 500px;">
... | github_jupyter |
# Adadelta
:label:`sec_adadelta`
Adadelta is yet another variant of AdaGrad (:numref:`sec_adagrad`). The main difference lies in the fact that it decreases the amount by which the learning rate is adaptive to coordinates. Moreover, traditionally it referred to as not having a learning rate since it uses the amount of ... | github_jupyter |
```
%matplotlib inline
```
# Partial Dependence Plots
Partial dependence plots show the dependence between the target function [2]_
and a set of 'target' features, marginalizing over the values of all other
features (the complement features). Due to the limits of human perception, the
size of the target feature set... | github_jupyter |
# UCI Kitsune Network Attack dataset
```
import pandas as pd
import numpy as np
import os
from pathlib import Path
from config import data_raw_folder, data_processed_folder
from timeeval import Datasets
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (20, 10)
dataset_collection_name... | github_jupyter |
# Метод интерполяции
## Реализация
Цель задания -- реализация метода интерполяции функции и проверка точности. Будем использовать кубический сплайн дефекта 1 и метод прогонки для вычисления коэффициентов.
### Описание алгоритма
Вспомним, что такое интерполяция кубическими сплайнами. У нас дана сетка $\{(x_i, y_i) \... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.