text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# 02_hsn_v1_lean-voc2012
```
import time
import skimage.io as imgio
import pandas as pd
import numpy.matlib
from adp_cues import ADPCues
from utilities import *
from dataset import Dataset
MODEL_CNN_ROOT = '../database/models_cnn'
MODEL_WSSS_ROOT = '../database/models_wsss'
dataset = 'VOC2012'
model_type = 'VGG16'
b... | github_jupyter |
```
#importing nevesary libraries
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
print("Done")
df_cust = pd.read_csv("Customer List.csv")
df_cust.head()
df_cust.tail()
df_cust.info()
df_cust.isnull().sum()
from sklearn.preprocessing import LabelEncoder
lb = LabelEncoder()
df_cust['Gender'] =... | github_jupyter |
# Jupyter lab on Sunbird using port forwarding
An excellent manual for Classic Jupyter: https://github.com/McWilliamsCenter/slurm_jupyter
I've tailored this manual for Swansea Sunbird for both Jupyter and Jupyter lab.
What is Swansea Sunbird ? https://portal.supercomputing.wales/index.php/about-sunbird/
# Installing... | github_jupyter |
# Transfer Learning with TensorFlow Hub for TFLite
## Set up library versions for TF2
```
# !pip uninstall tensorflow --yes
!pip install -U --pre -q tensorflow-gpu==2.0.0-beta1
# !pip install -U --pre -q tf-nightly-gpu-2.0-preview==2.0.0.dev20190715
# Last tested version: 2.0.0-dev20190704
# !pip install -U --pre -q ... | github_jupyter |
<a id="title_ID"></a>
# JWST Pipeline Validation Notebook: calwebb_detector1, firstframe unit tests
<span style="color:red"> **Instruments Affected**</span>: MIRI
### Table of Contents
<div style="text-align: left">
<br> [Introduction](#intro)
<br> [JWST Unit Tests](#unit)
<br> [Defining Terms](#terms)
<br> [T... | github_jupyter |
#タンパク質折りたたみ問題
量子アニーリングを用いた創薬関連のタンパク質折りたたみ問題がハーバード大学の先生によって2012年に発表されていました。そのタンパク質折りたたみ問題の論文を元に実際にwildqatで解いてみたいと思います。
##参考にする論文
natureに掲載されているこちらの論文をベースにします。
Finding low-energy conformations of lattice protein models by quantum annealing
Alejandro Perdomo-Ortiz, Neil Dickson, Marshall Drew-Brook, Geordie Rose & Alán... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/geemap/tree/master/examples/notebooks/geemap_and_earthengine.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href... | github_jupyter |
#### Copyright 2017 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 writin... | github_jupyter |
```
# Ensure the scenepic library will auto reload
%load_ext autoreload
# Imports
import json
import math
import os
import numpy as np
import scenepic as sp
%autoreload
# Seed random number generator for consistency
np.random.seed(0)
ASSET_DIR = os.path.join("..", "ci", "assets")
def asset_path(filename):
retur... | github_jupyter |
# Under the Hood
*Modeling and Simulation in Python*
Copyright 2021 Allen Downey
License: [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
# download modsim.py if necessary
from os.path import basename, exists
def download(url):
... | github_jupyter |
# What you will learn from this notebook
This notebook is supposed to demonstrate a simplified version of an actual analysis you might want to run. In the real world steps would be probably the same but the dataset itself would be much, much noisier (meaning it would take some effort to put it into the required shape)... | github_jupyter |
<br><br><br><br><br>
# Awkward datasets
<br><br><br><br><br>
<br><br><br><br><br>
It's not uncommon for data to be non-rectangular. Jagged ("ragged") arrays, cross-references, trees, and graphs are frequently encountered, but difficult to cast as Numpy arrays or Pandas DataFrames.
<br>
**Let's start with NASA's e... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc" style="margin-top: 1em;"><ul class="toc-item"></ul></div>
# Saving TF Models with SavedModel for TF Serving <a class="tocSkip">
```
import math
import os
import numpy as np
np.random.seed(123)
print("NumPy:{}".format(np.__version__))
import te... | github_jupyter |
# Face Recognition with SphereFace
Paper: https://arxiv.org/abs/1704.08063
Repo: https://github.com/wy1iu/sphereface
```
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm
import matplotlib.pyplot as plt
#We are going to use deepface to detect and align faces
#Repo: https://github.com/serengil/d... | github_jupyter |
Old Guestbook IP Extraction
===
This script processes the json guestbook in the old (2016) dataset to a CSV file containing the IP metadata.
```
%reload_ext autoreload
%autoreload 2
%matplotlib inline
import os
import re
import pandas as pd
import numpy as np
from collections import Counter
import sqlite3
from nltk ... | github_jupyter |
# Combining Thompson Sampling Results
```
import pinot
ds = pinot.data.moonshot()
actual_best = max([d[1].item() for d in ds])
import pandas as pd
best_human = pd.read_csv('best_Human.csv', index_col=0)
pro_human = pd.read_csv('pro_Human.csv', index_col=0)
retro_human = pd.read_csv('retro_Human.csv', index_col=0)
fo... | github_jupyter |
# Download ECG data
This notebook downloads ECG data from the [MIT-BIH Arrhythmia Database Directory](https://archive.physionet.org/physiobank/database/html/mitdbdir/mitdbdir.htm)
Copyright 2020 Dr. Klaus G. Paul
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and assoc... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as st
import probability_kernels as pk
```
#### Note to users
This Jupyter Notebook is for creating the figures in the paper. It also demonstrates how percentile transition matrices can be calculatd using the python file `pr... | github_jupyter |
### Analyse node statistics for benchmark results
In this notebook we analyse the node statistics, such as e.g. average degree, for correctly and
misclassified nodes, given the benchmark results of any community detection method.
First, we import the necessary packages.
```
%reload_ext autoreload
%autoreload 2
impor... | 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 |
```
import numpy as np
import torch
import sklearn
import sklearn.datasets
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
def load_data():
N = 500
gq = sklearn.datasets.make_gaussian_quantiles(mean=None, cov=0.7,
n_samples=N... | github_jupyter |
```
import read_data
import pandas as pd
import numpy as np
from IPython import embed
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import seaborn
import logging
import six
import scipy.stats
from sklearn.preprocessing import Imputer
df=pd.read_csv('dyl_ecoli_df.csv',usecols=['index', 'Week', 'Y... | github_jupyter |
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
pd.options.mode.chained_assignment = None
relevant_cols = ['Which round did you get your coop in?', 'Which sector was your first co-op in?']
software = class_df[relevant_cols].dropna()
software.head(100)... | github_jupyter |
# Springboard Logistic Regression Advanced Case Study
$$
\renewcommand{\like}{{\cal L}}
\renewcommand{\loglike}{{\ell}}
\renewcommand{\err}{{\cal E}}
\renewcommand{\dat}{{\cal D}}
\renewcommand{\hyp}{{\cal H}}
\renewcommand{\Ex}[2]{E_{#1}[#2]}
\renewcommand{\x}{{\mathbf x}}
\renewcommand{\v}[1]{{\mathbf #1}}
$$
This c... | github_jupyter |
```
import os
import numpy as np
import matplotlib.pyplot as plt
from keras.models import load_model
from keras.preprocessing.image import ImageDataGenerator
from panotti.datautils import build_dataset
```
# Class Distribution
```
import os
import glob
import pandas as pd
import seaborn as sns
import matplotlib.pyplo... | github_jupyter |
# TensorFlow Lattice estimators
In this tutorial, we will cover basics of TensorFlow Lattice estimators.
```
# import libraries
!pip install tensorflow_lattice
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_lattice as tfl
import tempfile
from six.moves import urllib
```
#... | github_jupyter |
```
# find the dataset definition by name, for example dtu_yao (dtu_yao.py)
def find_dataset_def(dataset_name):
module_name = 'datasets.{}'.format(dataset_name)
module = importlib.import_module(module_name)
return getattr(module, "MVSDataset")
"""
Implementation of Pytorch layer primitives, such as Conv+BN... | github_jupyter |
```
import sys
sys.path.append('..')
import torch
import numpy as np
import matplotlib.pyplot as plt
from lens import logic
torch.manual_seed(0)
np.random.seed(0)
# XOR problem
x_train = torch.tensor([
[0, 0],
[0, 1],
[1, 0],
[1, 1],
], dtype=torch.float)
y_train = torch.tensor([0, 1, 1, 0], dtype=tor... | github_jupyter |

#Ejercicio: Algoritmo genético para optimizar un rotor o hélice, paso a paso
##El problema
A menudo, en ingeniería, cuando nos enfrentamos a un problema, no podemos resolver directamente o despejar la solución como en los problemas sencillos típicos de matemáti... | github_jupyter |
The following additional libraries are needed to run this
notebook. Note that running on Colab is experimental, please report a Github
issue if you have any problem.
```
!pip install d2l==0.14.3
```
# Deep Convolutional Neural Networks (AlexNet)
:label:`sec_alexnet`
Although CNNs were well known
in the computer vis... | github_jupyter |
<a id="topD"></a>
# Downloading COS Data
# Learning Goals
<font size="5"> This Notebook is designed to walk the user (<em>you</em>) through: <b>Downloading existing Cosmic Origins Spectrograph (<em>COS</em>) data from the online archive</b></font>
**1. [Using the web browser interface](#mastD)**
\- 1.1. [The Classi... | github_jupyter |
```
!git clone https://github.com/broadinstitute/raman_classifier_challenge.git
import pandas as pd
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import seaborn as sns
df= pd.read_csv('raman_classifier_challenge/data/raman_data.csv')
df.describe()
df.dtypes
len(df)
df.head()
# Dataset cont... | github_jupyter |
# EJERCICIO 7
A partir de análisis clínicos y de la edad y el sexo de pacientes de una clínica ubicada en el noreste de Andhra Pradesh, India, se intentará obtener un clasificador automático que sirva para diagnosticar a pacientes con problemas de hígado.
Para esto, se recabaron muestras de ocho análisis distintos real... | github_jupyter |
# Train a CNN Model for MNIST
This script here is to train a CNN model with 2 convolutional layers each with a pooling layer and a 2 fully-connected layers. The variables that would be needed for inference later have been added to tensorflow collections in this script.
- The MNIST dataset should be placed under a ... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
```
### Indepedent Component Analysis
```
class icaDemo:
def __init__(self,N):
self.N = N
def remmean(self,sig):
newVec = np.zeros(sig.shape)
meanVal = np.mean(sig,axis=1)
newVec = sig-np.transpose(np.tile(meanVal,(self.N,1... | github_jupyter |
# Introduction to Numpy
NumPy is the fundamental package for scientific computing
in Python. It is a Python library that provides a multidimensional array
object. In this course, we will be using NumPy for linear algebra.
If you are interested in learning more about NumPy, you can find the user
guide and reference at... | github_jupyter |
```
%load_ext autoreload
from __future__ import print_function, division
%autoreload
import copy, math, os, pickle, time, pandas as pd, numpy as np, scipy.stats as ss
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import average_precision_s... | github_jupyter |
# **3D-RCAN**
---
<font size = 4>3D-RCAN is a neural network capable of image restoration from corrupted bio-images, first released in 2020 by [Chen *et al.* in biorXiv](https://www.biorxiv.org/content/10.1101/2020.08.27.270439v1).
<font size = 4> **This particular notebook enables restoration of 3D dataset. If y... | github_jupyter |
# Nosy Bagging Duelling Prioritised Replay Double Deep Q Learning - A simple ambulance dispatch point allocation model
## Reinforcement learning introduction
### RL involves:
* Trial and error search
* Receiving and maximising reward (often delayed)
* Linking state -> action -> reward
* Must be able to sense somethin... | github_jupyter |

> **Copyright (c) 2021 CertifAI Sdn. Bhd.**<br>
<br>
This program is part of OSRFramework. You can redistribute it and/or modify
<br>it under the terms of the GNU Affero General Public License as published by
<br>the Free Software Foundation, either versi... | github_jupyter |
# Circuit Basics
Here, we provide an overview of working with Qiskit. Qiskit provides the basic building blocks necessary to program quantum computers. The fundamental unit of Qiskit is the [quantum circuit](https://en.wikipedia.org/wiki/Quantum_circuit). A basic workflow using Qiskit consists of two stages: **Build... | github_jupyter |
# Segmenting and Clustering Neighborhoods in Toronto
Import requests and panda
```
import requests
import pandas as pd
```
Get the HTML of the Wiki page, convert into a table with help of read_html (read HTML tables into a list of DataFrame objects), remove cells with a borough that is Not assigned.
```
wiki = 'htt... | github_jupyter |
<p style="text-align: right;"> ✅ Put your name here</p>
# Pre-Class Assignment: Practice
In todays pre-class assignment you are going to practice what we have learned.
# Goals for today's pre-class assignment
</p>
1. topic
1. Assignment Wrap-up
```
# Read data for this assignment
%matplotlib inline
impor... | github_jupyter |
## Deep face recognition with Keras, Dlib and OpenCV
Face recognition identifies persons on face images or video frames. In a nutshell, a face recognition system extracts features from an input face image and compares them to the features of labeled faces in a database. Comparison is based on a feature similarity metr... | github_jupyter |

---
# Pandas Introduction
### with Stock Data and Correlation Examples
**Author list:** Alexander Fred-Ojala & Ikhlaq Sidhu
**References / Sources:**
Includes examples from Wes McKinney and the 10min intro to Pandas
**License Agreement:** Feel free to do whatever yo... | github_jupyter |
# Parameter estimation and hypothesis testing
```
#Import packages
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pymc3 as pm
from ipywidgets import interact
import arviz as az
%matplotlib inline
sns.set()
```
## Learning Objectives of Part 2
1. Understand what pr... | github_jupyter |
# Clonotype and sequence deduplication
Starting with annotated sequence data (in AbStar's `minimal` output format), reduces sequences to clonotypes and collapses dupicate clonotypes.
The [`abutils`](https://www.github.com/briney/abutils) Python package is required, and can be installed by running `pip install abutils... | github_jupyter |
```
#export
from fastai.basics import *
#hide
from nbdev.showdoc import *
#default_exp callback.progress
```
# Progress and logging callbacks
> Callback and helper function to track progress of training or log results
```
from fastai.test_utils import *
```
## ProgressCallback -
```
# export
@docs
class ProgressCa... | github_jupyter |
## In this Ipnyb , I'm going to build a model that can classify the Clothing Attribute Dataset which can be found at https://purl.stanford.edu/tb980qz1002 by the Category label. This is an image recognition and classification task . This dataset has only 1800 samples , out of which around 1100 samples have non - Nan va... | github_jupyter |
# Write summaries
TensorBoard helps us to summerize important parameters (such as wieghts, biases, activations, accuracy, loss, ...) to see how each parameter changes in each iteration of the training.
We can also see the images using TensorBoard
## Imports:
We will start with importing the needed libraries for our ... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
```
## Sigmoid function
```
def sigmoid(x):
return 1 / (1+np.exp(-x))
x = np.linspace(-10,10,100)
plt.plot(x, sigmoid(x), 'r', label='linspace(-10,10,10)')
plt.grid()
plt.title('Sigmoid Function')
plt.text(4, 0.8, r'$\... | github_jupyter |
```
# HIDDEN
from datascience import *
import numpy as np
path_data = '../../../../data/'
import matplotlib
matplotlib.use('Agg', warn=False)
%matplotlib inline
import matplotlib.pyplot as plots
plots.style.use('fivethirtyeight')
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)
from urlli... | github_jupyter |
```
from __future__ import division
from __future__ import print_function
import os
import time
import argparse
import numpy as np
import math
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from utils import load_data, accuracy, normalize, load_polblogs_da... | github_jupyter |
# Understanding Structured Point Clouds (SPCs)
Structured Point Clouds (SPC) is a differentiable, GPU-compatible, spatial-data structure which efficiently organizes 3D geometrically sparse information in a very compressed manner.

<b> When shoul... | github_jupyter |
# T81-558: Applications of Deep Neural Networks
* Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), School of Engineering and Applied Science, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx)
* For more information visit the [class website](https://sites.wust... | github_jupyter |
```
import tensorflow as tf
import numpy as np
from glob import glob
from deeplab import DeepLabV3Plus
from tensorflow.keras import backend as K
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint
print('TensorFlow', tf.__version__)
H, W = 512, 512
batch_size = 24
train_images = sorted(glob('resized_i... | 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 |
# "[ALGO&DS] Reverse a Linked List"
> "How to reverse a linked list both iteratively and recursively?"
- toc:false
- branch: master
- badges: false
- comments: true
- author: Peiyi Hung
- categories: [category, learning, algorithms]
# Introduction
Reversing a linked list is a classic problem by solving which we can ... | github_jupyter |
Cat Dog Classification
===
```
import tensorflow as tf
import os
import re
import numpy as np
import zipfile
import matplotlib.pyplot as plt
from tensorflow.contrib import learn
from tensorflow.contrib.learn.python.learn.estimators import model_fn
from tensorflow.contrib.learn import RunConfig as run_config
slim = t... | github_jupyter |
```
knitr::opts_chunk$set(cache=TRUE)
knitr::opts_chunk$set(warning = FALSE)
```
# RML Notes
+ [RML Package Homepage](aka.ms/RML)
The `MicrosoftRML` (or `RML` for short) package is a state-of-the-art package of machine learning algorithms developed by Microsoft's Algorithms Development team and Microsoft Research... | github_jupyter |
# Analysis of TRPO
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as sts
plt.close('all')
delta = 0.2
def read_data(path):
df = pd.read_csv(path + 'progress.csv')
iterations = len(df)
batch_size = df['EpLenMean']
sigma_1 = []
sigma_2 = []
theta ... | github_jupyter |
# 準備
```
# バージョン指定時にコメントアウト
#!pip install torch==1.7.0
#!pip install torchvision==0.8.1
import torch
import torchvision
# バージョンの確認
print(torch.__version__)
print(torchvision.__version__)
# Google ドライブにマウント
from google.colab import drive
drive.mount('/content/gdrive')
%cd '/content/gdrive/MyDrive/Colab Notebooks/gan_... | github_jupyter |
___
<a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>
___
<center><em>Copyright Pierian Data</em></center>
<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>
# NumPy Exercises - Solutions
Now that we've learned about N... | github_jupyter |
```
# 기본 환경 로드
%run ./env.ipynb
```
# Fit Data Model
ETL를 통해 생성된 데이터셋을 이용하여 훈련을 통해 데이터 모델을 생성합니다.
DNN 모델과 비교를 위해 RandomForest 모델을 훈련해봅니다.
```
from utils import *
sdate = get_env_sdate(default = "2018070108")
path_base = get_env_path_base(default = "/root/mnt/dfs/notebooks-skp/mnist")
path_data = get_env_path_date(... | github_jupyter |
# Plotting kde objects
```
import scipy.stats as stats
import matplotlib.pyplot as plt
%matplotlib inline
```
# 1d kde
```
kde = stats.gaussian_kde(np.random.normal(loc=50, scale=5, size=100000))
x = np.arange(0, 100, 1)
plt.plot(x, kde(x))
plt.show()
```
## 2d kde
```
from scipy import stats
def measure(n):
"... | github_jupyter |
## Understanding ROS Topics
This tutorial introduces ROS topics as well as using the `rostopic` and commandline tool.
Source: [ROS Wiki](http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics)
Let's start by making sure that we have `roscore` running:
```
%%bash
rosnode list
```
If an error is shown, you need to l... | github_jupyter |
# Hierarchical Clustering
**Hierarchical clustering** refers to a class of clustering methods that seek to build a **hierarchy** of clusters, in which some clusters contain others. In this assignment, we will explore a top-down approach, recursively bipartitioning the data using k-means.
**Note to Amazon EC2 users**:... | github_jupyter |
```
import cranet
from cranet import nn, optim
from cranet.nn import functional as F
from cranet.util import load_pickle
from cranet.data import Dataset, DataLoader
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import confusion_matrix
import itertools
import os
print(cranet.__version__... | github_jupyter |
# How to create gates from physical processes
This tutorial shows how to use the `InterpolatedDenseOp` and `InterpolatedOpFactory` to create quick-to-evaluate operations by interpolating between the discrete points at quick a more computationally-intensive process is performed. Often the computationally intensive proc... | github_jupyter |
# Description
* This is the one used
# Setting variables
```
import os
## What is the base directory?
baseDir = '/home/sam/notebooks/hemp_microbiome/data/ITS_OTUs/'
## What directory do you want to work in and keep all subsequent files in?
workDir = os.path.join(baseDir, "OTU_binning")
## Where is your final QC'e... | github_jupyter |
# <center>
<img src="https://gitlab.com/ibm/skills-network/courses/placeholder101/-/raw/master/labs/module%201/images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# **Space X Falcon 9 First Stage Landing Prediction**
## Lab 2: Data wrangling
Estimated time needed: **60** minutes
In this... | 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 |
# PIO Programming
Resources:
* [RP2040 Datasheet Section 3.4](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf)
Life with David
## Setting multiple pins from Python
```
%serialconnect
from machine import Pin
import time
from rp2 import PIO, StateMachine, asm_pio
# decorator to translate to PIO mach... | github_jupyter |
# Задание 1.1 - Метод К-ближайших соседей (K-neariest neighbor classifier)
В первом задании вы реализуете один из простейших алгоритмов машинного обучения - классификатор на основе метода K-ближайших соседей.
Мы применим его к задачам
- бинарной классификации (то есть, только двум классам)
- многоклассовой классификац... | github_jupyter |
# Plot3D Python Tutorial
In this tutorial you will learn about the Plot3D NASA Standard and how to use NASA's Plot3D python library to read, write, find connectivity, split blocks, and find periodicity.
## About Plot3D
Plot3D is a standard for defining a simple structured grid. This standard was developed in the 1980'... | github_jupyter |
<small><small><i>
All the IPython Notebooks in **[Python Natural Language Processing](https://github.com/milaan9/Python_Python_Natural_Language_Processing)** lecture series by **[Dr. Milaan Parmar](https://www.linkedin.com/in/milaanparmar/)** are available @ **[GitHub](https://github.com/milaan9)**
</i></small></small>... | github_jupyter |
Pix2Pix dataset: downloading and preprocessing
=========================================
The pix2pix dataset has been released as part of the paper "Image-to-Image Translation with Conditional Adversarial Networks" [arxiv](https://arxiv.org/abs/1611.07004) and it contains five different datasets: cityscapes, edges2han... | github_jupyter |
# Autograd: automatic differentiation
The ``autograd`` package provides automatic differentiation for all operations
on Tensors. It is a define-by-run framework, which means that your backprop is
defined by how your code is run, and that every single iteration can be
different.
```
#importing pytorch
import torch
```... | github_jupyter |
Preprocessing an input string is the basis needed to do higher-level operations such as tokenizing.
```
input_str = '༆ ཤི་བཀྲ་ཤིས་ tr བདེ་་ལེ གས། བཀྲ་ཤིས་བདེ་ལེགས་༡༢༣ཀཀ། མཐའི་རྒྱ་མཚོར་གནས་པའི་ཉས་ཆུ་འཐུང་།། །།'
```
# pybotextchunks.py
This class is a wrapper around PyBoChunk (that it subclasses).
Its main purpose is... | github_jupyter |
```
import pandas as pd
from gensim.models import FastText
from keras.preprocessing.text import Tokenizer, text_to_word_sequence
from sklearn.feature_extraction.text import CountVectorizer
from nltk.corpus import stopwords
from sklearn.manifold import TSNE
import os
import tensorflow as tf
import numpy as np
import r... | github_jupyter |
<a href="https://colab.research.google.com/github/lululxvi/deepxde/blob/master/examples/Lorenz_inverse_forced_Colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Description
This notebook aims at the identification of the parameters of the modi... | github_jupyter |
```
import numpy as np
import pandas as pd
import sklearn
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
infile = '../ChronoLSTM_1d_bin3/DATA_Linear/xvyw1beta9.5gammax1.0gammay1.0epsln1.0sgma1.0A1.0x01.122w0.8B0.15a... | github_jupyter |
# Setup
```
import pandas as pd
import numpy as np
import jsonlines
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import torch.nn as nn
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
impor... | github_jupyter |
# Lambda distribution (Vs Reff)
```
import matplotlib.pyplot as plt
import pickle
import numpy as np
## fucntions
def load_pickle(fname):
with open(fname, 'rb') as f:
return pickle.load(f)
def plot_lambda(catalog, i_early, i_late, i_bad, fn_out='./'):
import matplotlib.pyplot as plt
plt.ioff()
... | github_jupyter |
<a href="https://colab.research.google.com/github/apergo-ai/CRASS-data-set/blob/main/OpenAIinterface_master.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import numpy as np
import io
import pandas as pd
import random
import re
import sys
!pip ... | github_jupyter |
# Precipitation exercises
***
## <font color=steelblue>Exercise 3 - Double-mass curve</font>
<font color=steelblue>Perform a double-mass curve analysis with the data in sheet *Exercise_003* from file *RainfallData.xlsx*.</font>
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seabo... | github_jupyter |
```
# !wget https://raw.githubusercontent.com/UniversalDependencies/UD_English-EWT/master/en_ewt-ud-dev.conllu
# !wget https://raw.githubusercontent.com/UniversalDependencies/UD_English-EWT/master/en_ewt-ud-train.conllu
# !wget https://raw.githubusercontent.com/UniversalDependencies/UD_English-EWT/master/en_ewt-ud-test... | github_jupyter |
## Musterlösung zu Projektaufgabe Deskriptive Statistik und offene Fragen
#### Grundlage: Datensatz der San Francisco Public Library, s.a. https://zbmed.github.io/2020-2021-ZK_Data_Librarian_Modul_3/organisation/dataset/
##### Frage 1: Wie viele Senioren und Kinder sind Kunden der San Francisco Public Library?
#####... | github_jupyter |
```
!pip install chart_studio
import plotly.graph_objects as go
import plotly.offline as offline_py
import plotly.graph_objects as go
import plotly.offline as offline_py
from wordcloud import WordCloud
import matplotlib.pyplot as plt
import plotly.figure_factory as ff
import numpy as np
%matplotlib inline
import panda... | github_jupyter |
Originaly taken from https://www.easy-tensorflow.com and adapted for the purpose of the course
# Imports
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
```
# Load the MNIST dataset
## Data dimenstion
```
from tensorflow.examples.tutorials.mnist import input_data
img_h = img_w = 28 #... | github_jupyter |
# Is it reasonable to consider only largest mergers among many?
Multiple mergers can occur at a time. Especially when merger takes long, another merger can begin before one ends. Then the effect of a merger can't be separated. In such case, I take the largest merger only.
But how reliable is it?
This script shows di... | github_jupyter |
```
import os
import pandas as pd
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.callbacks import EarlyStopping, History, ModelCheckpoint
from keras.layers.core import Flatten, Dense, Dropout, Reshape, Lambda
from keras.layers.normalization import BatchNo... | github_jupyter |
```
import pandas as pd
import json
import requests
import numpy as np
```
# Points intersecction
Procedure definition:
```sql
DROP FUNCTION get_aqpoints(weights_raw TEXT, points_array TEXT);
DROP TYPE weight_intersection;
CREATE TYPE weight_intersection AS (points_id numeric, basinid numeric, the_geom geometry... | github_jupyter |
# Calculating the Bilingual Evaluation Understudy (BLEU) score: Ungraded Lab
In this ungraded lab, we will implement a popular metric for evaluating the quality of machine-translated text: the BLEU score proposed by Kishore Papineni, et al. In their 2002 paper ["BLEU: a Method for Automatic Evaluation of Machine Trans... | github_jupyter |
# Lab 2: Inference in Graphical Models
### Machine Learning 2, 2016
* The lab exercises should be made in groups of two people.
* The deadline is Sunday, April 24, 23:59.
* Assignment should be sent to t.s.cohen at uva dot nl (Taco Cohen). The subject line of your email should be "[ML2_2016] lab#_lastname1\_lastname2... | github_jupyter |
# Advanced Ray - Overview
© 2019-2020, Anyscale. All Rights Reserved

This tutorial, part of [Anyscale Academy](https://anyscale.com/academy), picks up where the [Ray Crash Course](../ray-crash-course/00-Ray-Crash-Course-Overview.ipynb) left off. It explores task... | github_jupyter |
# Tris
## Les plus simples
Implanter les trois tris classiques suivants, selon les algorithmes vus en cours.
**Remarque : en python on peut échanger deux variables comme ça **
```
a = 5
b = 6
a,b = b,a
print a
print b
def triSelection(t):
"""
Tri sélection
Sélectionne un élément minimal à chaque itérati... | github_jupyter |
Avani Gupta <br>
Roll: 2019121004
# Excercise - Multi-class classification of MNIST using Perceptron
In binary perceptron, where $\mathbf{y} \in \{-1, +1\}$, we used to update our weights only for wrongly classified examples.
The multi-class perceptron is regarded as a generalization of binary perceptron. Learning t... | github_jupyter |
# Descriptive stats for datasets and network localization
-------------------
Author: Brin Rosenthal (sbrosenthal@ucsd.edu)
-------------------
Notebook to calculate localization of dDNV sets, and measure number of patients with a dDNV in established disease genes, in a non-disease gene (non-recurrent), or no dDNVs... | github_jupyter |
# Taller de Datos Abiertos
**Nivel : Medio**
Este Jupyter Notebook es para aprender conceptos básicos de la ciencia de datos utilizando la plataforma Datos Abiertos de Cali, Colombia. En este libro aprenderá cómo:
- Recopilar datos de una API
- Datos limpios
- Visualizar y trazar datos
- Crea un visual genial de dato... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.