text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` !git clone https://github.com/NVlabs/stylegan3.git !pip install --upgrade psutil # based on https://github.com/Sxela/stylegan3_blending/blob/main/stylegan3_blending_public.ipynb import os import sys sys.path.append(os.path.join(os.path.abspath(""), "stylegan3")) import copy import math import pickle from glob impo...
github_jupyter
<table> <tr><td align="right" style="background-color:#ffffff;"> <img src="../images/logo.jpg" width="20%" align="right"> </td></tr> <tr><td align="right" style="color:#777777;background-color:#ffffff;font-size:12px;"> Abuzer Yakaryilmaz | April 04, 2019 (updated) </td></tr> <tr><td...
github_jupyter
# Policy Gradient (PG) Referências: - [Schulman, John. _Optimizing Expectations_: From Deep Reinforcement Learning to Stochastic Computation Graphs](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-217.html). - [Spinning Up](https://spinningup.openai.com/en/latest/spinningup/rl_intro3.html) # Conceito Em t...
github_jupyter
# Introduction to Programming with Python # Unit 4: Loops Our task of generating a problem book with quadratic equations will only be useful, if we can generate many equations of the same type, not just one. Computer is very good at repeating the same computations, so the ability for us to express the idea of repeati...
github_jupyter
# Aerospike Java Client – Advanced Collection Data Types *Last updated: June 22, 2021* The goal of this tutorial is to highlight the power of working with [collection data types (CDTs)]("https://docs.aerospike.com/docs/guide/cdt.html") in Aerospike. It covers the following topics: 1. Setting [contexts (CTXs)]("https:/...
github_jupyter
# Assignment 3 - Practical Deep Learning Workshop #### In this task we will work with the dataset of the Home depot product search relevance competition. #### Some background: In this competition, Home Depot is asking to help them improve their customers' shopping experience by developing a model that can accurately ...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # $\texttt{GiRaFFE}$: General Relativistic Force-Free Elect...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-credit-card-fraud/auto-ml-classification-credit-card-fraud....
github_jupyter
# Word2Vec for Text Classification In this short notebook, we will see an example of how to use a pre-trained Word2vec model for doing feature extraction and performing text classification. We will use the sentiment labelled sentences dataset from UCI repository http://archive.ics.uci.edu/ml/datasets/Sentiment+Labell...
github_jupyter
# ニコニコAIスクール 第1回 Python入門 基礎演習 ## 今日の目標 * Pythonのデータ型と各データ型の取り扱い方を覚える。 * Pythonで頻出する概念を覚える。 * Numpyを用いてベクトル・行列の計算及び操作を記述し、実行できる。 ## キーワード * Python3 * データ型 (int, float, str, bool) * リスト、タプル、辞書 * numpy ## Jupyter notebookことはじめ コードの編集:各セルをクリックして、その中で直接編集 コードの実行:画面上の再生ボタンをクリックまたはShift+Enter 実行停止:画面上の停止ボタンをクリック Note...
github_jupyter
# 6.1 Reading and Writing Data in Text Format ``` import pandas as pd import numpy as np df = pd.read_csv('datasets/ex1.csv') df df = pd.read_table('datasets/ex1.csv', sep=',') df pd.read_csv('datasets/ex2.csv', header=None) pd.read_csv('datasets/ex2.csv', names=['a', 'b', 'c', 'd', 'message']) names = ['a', 'b', 'c',...
github_jupyter
## Overview - Business Understanding In this notebook, I would like to explore the educational and job satisfaction characteristics of respondents of the survey based in Nigeria. To achieve this, I will retrieve data from the Stackoverflow developer survey 2017. The questions that I am interested in asking are; - Wha...
github_jupyter
<h2>Grover's Search: One Qubit Representation</h2> [Watch Lecture](https://youtu.be/VwzshIQsDBA) The execution of Grover's search algorithm can be simulated on the unit circle. Throughout the computation, the amplitudes of the marked (or unmarked) elements never differ from each other. Therefore, we can group the e...
github_jupyter
# TSG037 - Determine master pool pod hosting primary replica ## Description Determine the pod that hosts the primary replica for the Big Data Cluster when master pool high availability is enabled. For BDC deployed with High availability, the master pool has at least three master PODs (availablity group replicas), SQ...
github_jupyter
``` import keras print(keras.__version__) #Importing Libraries import sys import os import numpy as np import pandas as pd from tensorflow.keras import Sequential from keras.layers import Dense,Dropout,Activation,Flatten from keras.layers import Conv2D,MaxPooling2D,BatchNormalization,AveragePooling2D from keras.losses ...
github_jupyter
# Text *Under construction* <!-- ## Strings [Strings](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str) are defined using (single or double) quotes: ```python mathematician = 'Ramanujan' print(mathematician) ``` Ramanujan A [string](https://docs.python.org/3/library/stdtypes.html#text-...
github_jupyter
# Lab 04 : Test set evaluation -- demo ``` # For Google Colaboratory import sys, os if 'google.colab' in sys.modules: from google.colab import drive drive.mount('/content/gdrive') file_name = 'test_set_demo.ipynb' import subprocess path_to_file = subprocess.check_output('find . -type f -name ' + st...
github_jupyter
# What is Survival Analysis? [Survival analysis](https://en.wikipedia.org/wiki/Survival_analysis) is used to study the **time** until some **event** of interest (often referred to as **death**) occurs. Time could be measured in years, months, weeks, days, etc. The event could be anything of interest. It could be an...
github_jupyter
# Import Modules ``` import os print(os.getcwd()) import sys import pandas as pd import numpy as np from pymatgen.io.ase import AseAtomsAdaptor # ######################################################### from methods import get_df_dft # ######################################################### # from local_method...
github_jupyter
<i>Copyright (c) Microsoft Corporation.</i> <i>Licensed under the MIT License.</i> # ARIMA: Autoregressive Integrated Moving Average This notebook provides an example of how to train an ARIMA model to generate point forecasts of product sales in retail. We will train an ARIMA based model on the Orange Juice dataset....
github_jupyter
# Assignment Algorithms : Part 1 The purpose of this notebook is to explore the fiberassign algorithms and the consequences of introducing different target populations and realistic nominal positioner motions and exclusion zones. Very often people see behavior of the fiberassign code which does not match their intuit...
github_jupyter
``` # Necessary imports import pylab as py import numpy as np import qiskit as qk from qiskit import Aer from qiskit import assemble from scipy.linalg import eigvalsh, eigh # Define the Pauli matrices here to reduce dependencies on other packages X = np.array([[0,1],[1,0]],dtype=float) Z = np.array([[1,0],[0,-1]],dty...
github_jupyter
# 1Strategy ML Immersion Day ### Building an xgboost model from movie data ``` import json import math import sys import boto3 import matplotlib.pyplot as plt import numpy as np import pandas as pd import sagemaker as sm from sagemaker.amazon.amazon_estimator import get_image_uri import workshop_utils as wu # preve...
github_jupyter
<a href="https://colab.research.google.com/github/Sparrow0hawk/crime_sim_toolkit/blob/crime_cat_refac/data_manipulation/Forces_%2B_LSOAs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Generate a reference document matching LSOAs to Police Force c...
github_jupyter
# Sensitivity Tests Output ``` import numpy as np import matplotlib.pyplot as plt import matplotlib import pandas as pd import os from tqdm import tqdm from pathlib import Path import photoeccentric as ph from pathlib import Path plt.rcParams['figure.dpi'] = 150 def rmdir(directory): directory = Path(director...
github_jupyter
# DoWhy: Different estimation methods for causal inference This is a quick introduction to the DoWhy causal inference library. We will load in a sample dataset and use different methods for estimating the causal effect of a (pre-specified)treatment variable on a (pre-specified) outcome variable. First, let us add the ...
github_jupyter
# Jouer avec les mots Les mots utilisés dans ce chapitre sont des mots français pour le Scrabble de Jean-Philippe Durand, disponible sous http://jph.durand.free.fr/scrabble.txt Le document est sauvegardé localement sous le nom `mots.txt`. ## Lire des listes de mots La première action est de créer une objet `fichier...
github_jupyter
``` #!/usr/bin/env python3 """feature_vectors.ipynb James Gardner 2019 reads in TGSS and NVSS sources in a 20° patch of sky and computes positional matches within 10' adds labels based off of positional matching requires the unzipped catalogues to be present in cwd and expects names: TGSSADR1_7sigma_catalog.tsv and C...
github_jupyter
# Cross-Validation and the Test Set In the last lecture, we saw how keeping some data hidden from our model could help us to get a clearer understanding of whether or not the model was overfitting. This time, we'll introduce a common automated framework for handling this task, called **cross-validation**. We'll also i...
github_jupyter
``` from z3 import * import numpy as np from itertools import combinations from typing import Sequence from tqdm.notebook import tqdm ``` Read instance file: ``` input_filename = '../../Instances/12x12.txt' w, h, n, DX, DY = None, None, None, None, None with open(input_filename, 'r') as f_in: lines = f_in.read(...
github_jupyter
``` import sys sys.path.append("..") import pandas as pd import numpy as np from numba import jit import json import matplotlib.pyplot as plt import seaborn as sns import numpy as np import xmltodict import numpy.polynomial as p from multiprocessing import Pool import time from datetime import datetime , date, timedelt...
github_jupyter
# Report for yuvipanda ``` import seaborn as sns import pandas as pd import numpy as np import altair as alt from markdown import markdown from IPython.display import Markdown from ipywidgets.widgets import HTML, Tab from ipywidgets import widgets from datetime import timedelta from matplotlib import pyplot as plt imp...
github_jupyter
``` import pandas as pd import datetime as dt ``` # testing it ## Review of Python's `datetime` Module ``` someday = dt.date(2010, 1, 20) someday.year someday.month someday.day str(someday) str(dt.datetime(2010, 1, 10, 17, 13, 57)) sometime = dt.datetime(2010, 1, 10, 17, 13, 57) sometime.year sometime.month some...
github_jupyter
# The Basic Tools of the Deep Life Sciences Welcome to DeepChem's introductory tutorial for the deep life sciences. This series of notebooks is a step-by-step guide for you to get to know the new tools and techniques needed to do deep learning for the life sciences. We'll start from the basics, assuming that you're ne...
github_jupyter
# stockmanager stockmanager has the following main modules: - Ticker: a class to retrieve price, company info of a ticker. - visualization: a set of visualization functions, e.g. plot_price() - Portfolio: a class ``` from stockmanager import Ticker, Portfolio, plot_price # For debugging: import matplotlib.pyplot a...
github_jupyter
# Naive Bayes Classifiers We want to classify vectors of discrete value features, $\mathbf{x}\in\{1,\ldots,K\}^D$, where $K$ is the number of values for each feature, and $D$ is the number of features. If we use a generative approach, we will need to specify the class conditional distribution $p(\mathbf{x}|y=c), c\in\...
github_jupyter
### Лекция 5. Шаблоны <br /> ##### Какая идея стоит за шаблонами Ранее мы познакомились с возможностью перегрузки функций. Давайте вспомним её на примере swap: ```c++ // поменять местами два int void my_swap(int& a, int& b) { int tmp = a; a = b; b = tmp; } // поменять местами два short void my_swap...
github_jupyter
# Lista 01 - EDA + Visualização ``` # -*- coding: utf 8 from matplotlib import pyplot as plt import pandas as pd import numpy as np plt.style.use('seaborn-colorblind') plt.ion() ``` # Exercício 01: Em determinadas épocas do ano a venda de certos produtos sofre um aumento significativo. Um exemplo disso, são as ven...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns # Plot parameters sns.set() %pylab inline pylab.rcParams['figure.figsize'] = (4, 4) plt.rcParams['xtick.major.size'] = 0 plt.rcParams['ytick.major.size'] = 0 # Avoid inaccurate floating values (for inverse matrices in dot product for instance)...
github_jupyter
##### Copyright 2020 The TensorFlow IO 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 ...
github_jupyter
# Process specifications Dynamically adjusting parameters in a process to meet a specification is critical in designing a production process, and even more so when its under uncertaintly. BioSTEAM groups process specifications into two categories: analytical specifications, and numerical specifications. As the name su...
github_jupyter
# 3.1 Expressions # Programming languages are much simpler than human languages. Nonetheless, there are some rules of grammar to learn in any language, and that is where we will begin. In this text, we will use the [Python](https://www.python.org/) programming language. Learning the grammar rules is essential, and the ...
github_jupyter
``` import arviz as az import matplotlib.pyplot as plt import numpy as np import pymc3 as pm %load_ext watermark az.style.use('arviz-darkgrid') ``` # Sequential Monte Carlo - Approximate Bayesian Computation Approximate Bayesian Computation methods (also called likelihood free inference methods), are a group of techn...
github_jupyter
# Suave demo notebook: BAO basis on a periodic box Hello! In this notebook we'll show you how to use suave, an implementation of the Continuous-Function Estimator, with a basis based on the standard baryon acoustic oscillation (BAO) fitting function. ``` import os import numpy as np import matplotlib.pyplot as plt i...
github_jupyter
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_01_3_python_collections.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # T81-558: Applications of Deep Neural Networks **Module 1: Python P...
github_jupyter
## Compare CBC and Gurobi Compare the computation time of the CBC and Gurobi solvers for the same scenarios ``` import logging import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 import numpy as np import random import seaborn as sns import panda...
github_jupyter
``` txt = '''Coronavirus disease 2019 (COVID-19), also known as the coronavirus, or COVID, is a contagious disease caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). The first known case was identified in Wuhan, China, in December 2019.[7] The disease has since spread worldwide, leading to an ongoi...
github_jupyter
**Sustainable Software Development, block course, March 2021** *Scientific Software Center, Institute for Scientific Computing, Dr. Inga Ulusoy* # Analysis of the data Imagine you perform a "measurement" of some type and obtain "scientific data". You know what your data represents, but you have only a vague idea ho...
github_jupyter
# Implementing Simple Linear regression Python implementation of the linear regression exercise from Andrew Ng's course: Machine Learning on coursera. Exercise 1 Source notebooks: [1][1] [2][2] [3][3] [4][4] [1]:https://github.com/kaleko/CourseraML/blob/a815ac95ba3d863b7531926b1edcdb4f5dd0eb6b/ex1/ex1.ipynb [2...
github_jupyter
``` import pandas as pd import numpy as np import calendar import math import re import string import segmentation import utils import data2graph from finetuned import T5FineTuner, BARTFineTuner, generate, generate_beam, graph2text_nobeam, graph2text_nobeam_ngram_es, graph2text_nobeam_topk, graph2text_nobeam_topp impor...
github_jupyter
``` from IPython.display import HTML tag = HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide() } else { $('div.input').show() } code_show = !code_show } $( document ).ready(code_toggle); </script> Toggle cell visibility <a href="javascript:c...
github_jupyter
# PRMS v6 BMI coupling - runtime interaction demo * This demonstration will illustrate how the coupled surface-, soil-, groundwater-, and streamflow-BMIs can be interacted with at runtime. * Some initial setup including matching an HRU polygon shapefile with order of HRUs in input file * Visualizing results by...
github_jupyter
# Ingest data with Redshift This notebook demonstrates how to set up a database with Redshift and query data with it. We are going to use the data we load into S3 in the previous notebook [011_Ingest_tabular_data.ipynb](011_Ingest_tabular_data_v1.ipynb) and database and schema we created in [02_Ingest_data_with_Athena....
github_jupyter
<a href="https://colab.research.google.com/github/Manan1811/FaceNet-Model/blob/main/FaceNet_Model2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !nvidia-smi from google.colab import drive drive.mount('/content/drive') !wget https://data.vision...
github_jupyter
[Index](Index.ipynb) - [Back](Widget Styling.ipynb) - [Next](Widget Asynchronous.ipynb) ``` from __future__ import print_function ``` # Building a Custom Widget - Hello World The widget framework is built on top of the Comm framework (short for communication). The Comm framework is a framework that allows the kerne...
github_jupyter
``` %load_ext autoreload %autoreload 2 ``` > **How to run this notebook (command-line)?** 1. Install the `ReinventCommunity` environment: `conda env create -f environment.yml` 2. Activate the environment: `conda activate ReinventCommunity` 3. Execute `jupyter`: `jupyter notebook` 4. Copy the link to a browser # `REI...
github_jupyter
<a href="https://colab.research.google.com/github/RSNA/AI-Deep-Learning-Lab-2021/blob/main/sessions/object-detection-seg/segmentation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Overview In this tutorial we will explore how to create a contra...
github_jupyter
© 2020 Nokia Licensed under the BSD 3 Clause license SPDX-License-Identifier: BSD-3-Clause ## Setup ``` %load_ext autoreload %autoreload 2 import os import json import time import numpy as np import sys from codesearch.encoders import BasicEncoder from codesearch import embedding_pretraining from codesearch.embed...
github_jupyter
# Word2Vec with CNN and Bi-LSTM - word2vec vector values as weights for LSTM to train ``` import numpy as np import pandas as pd import os import nltk import sklearn from gensim.models import Word2Vec import re import multiprocessing import tensorflow as tf from keras.preprocessing.text import Tokenizer from collectio...
github_jupyter
``` import requests import datetime from datetime import datetime as dt import patoolib import os import pandas as pd import sqlalchemy import psycopg2 from sqlalchemy import create_engine import numpy as np from datetime import timedelta import os.path from datetime import datetime import sqlalchemy as sa #from sqlal...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set() from google.colab import files uploaded = files.upload() ``` ### ***Train Data*** ``` train_data = pd.read_excel('Data_Train.xlsx') pd.set_option('display.max_columns',None) train_data.head()...
github_jupyter
# Training Neural Networks The network we built in the previous part isn't so smart, it doesn't know anything about our handwritten digits. Neural networks with non-linear activations work like universal function approximators. There is some function that maps your input to the output. For example, images of handwritt...
github_jupyter
# Class Session 2 ## Comparing running times for enumerating neighbors of all vertices in a graph (with different graph data structures) In this notebook we will measure the running time for enumerating the neighbor vertices for three different data structures for representing an undirected graph: - adjacency matrix ...
github_jupyter
# Example: CanvasXpress scatter2d Chart No. 1 This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at: https://www.canvasxpress.org/examples/scatter2d-1.html This example is generated using the reproducible JSON obtained from the above p...
github_jupyter
##### Copyright 2018 The TensorFlow Probability Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of th...
github_jupyter
``` import os, sys, gc import time import glob import pickle import copy import json import random from collections import OrderedDict, namedtuple import multiprocessing import threading import traceback from typing import Tuple, List import h5py from tqdm import tqdm, tqdm_notebook import numpy as np import pandas ...
github_jupyter
# Getting Started ## Install Dependencies This is a tutorial of using D4 in Python. Before you started trying this document, please make sure you have D4 package and `d4tools` binary installed. * To install the d4tools binary, please read the instruction from [this link](https://github.com/38/d4-format#installation...
github_jupyter
# Fast Fourier Transform Forecasting Model (FFT) The following is a brief demonstration of the FFT forecasting model. This model is especially suited for data that is very seasonal. The datasets chosen for this demonstration were selected accordingly. ``` # fix python path if working locally from utils import fix_pyth...
github_jupyter
# Introduction Involve 10 Models Clustering <br> <br> <font color = 'blue'> <b>Content: </b> 1. [Prepare Problems] * [Load Libraries](#2) * [Load Dataset](#3) 1. [Models] * [K-Means](#4) * [Affinity Propagation](#5) * [BIRCH](#6) * [DBSCAN](#7) * [Mini Batch K-Means](#8) * [Mean ...
github_jupyter
# Robot Class In this project, we'll be localizing a robot in a 2D grid world. The basis for simultaneous localization and mapping (SLAM) is to gather information from a robot's sensors and motions over time, and then use information about measurements and motion to re-construct a map of the world. ### Uncertainty A...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np import sklearn as sk import seaborn as sns import statsmodels.api as sm import statsmodels.formula.api as smf import statsmodels.tsa.api as smt import itertools import warnings import scipy.signal as sp import...
github_jupyter
# An example of the Nonlinear inference with multiple latent functions. This notebook briefly shows an example for an inverse problem where multiple latent functions to be infered. *Keisuke Fujii 3rd Oct. 2016* ## Synthetic observation Consider we observe a cylindrical transparent mediam with multiple ($N$) lines-o...
github_jupyter
``` from mcts_simple import Game class TicTacToe(Game): def __init__(self): self.board = {char + str(num + 1): " " for char in "abc" for num in range(3)} self.players = ["X", "O"] self.player_turn = 0 self.prev_actions = [] def win_conditions(self): return ((self.board[...
github_jupyter
``` ######################################## ## import packages ######################################## import os import re import csv import codecs import numpy as np import pandas as pd import operator from nltk.corpus import stopwords from nltk.stem import SnowballStemmer from string import punctuation from textbl...
github_jupyter
# Effect of learning rate In this notebook, we will discuss the impact of learning rate, which will determine step size and change the distance from initialzation to the solution, which contributes to breaking the NTK regime. ``` import torch from torch import optim, nn from torchvision import datasets, transforms fr...
github_jupyter
## Day 3: Cells in Silicon Welcome to Day 3! Today, we start with our discussion with the Hodgkin Huxley Neurons and how we can simulate them in python using Tensorflow and Numerical Integration. ### What is the Hodgkin Huxley Neuron Model? (Modified from Neuronal Dynamics, EPFL) Hodgkin and Huxley performed many e...
github_jupyter
# Styling *New in version 0.17.1* <span style="color: red">*Provisional: This is a new feature and still under development. We'll be adding features and possibly making breaking changes in future releases. We'd love to hear your feedback.*</span> This document is written as a Jupyter Notebook, and can be viewed or d...
github_jupyter
## Engineering Rare Categories Rare values are categories within a categorical variable that are present only in a small percentage of the observations. There is no rule of thumb to determine how small is a small percentage, but typically, any value below 5 % can be considered rare. As we discussed in section 3 of th...
github_jupyter
# Projet Morpion par *Hélène et Victoria* ; Bugnon Ours, oc.info 2018/2019 Morpion est un jeux simple qui se joue sur un cadrillage 3x3. Le but est d'aligner 3 jetons en colonne, ligne au en diagonale. Le jeux est joué sur la plateforme SenseHAT pour le Raspberry Pi. Dans ce notebook, des fragment de code sont expliq...
github_jupyter
# K-Nearest Neighbors Algorithm * Last class, we introduced the probabilistic generative classifier. * As discussed, the probabilistic generative classifier requires us to assume a parametric form for each class (e.g., each class is represented by a multi-variate Gaussian distribution, etc..). Because of this, the ...
github_jupyter
### HGT features in A. castellanii **cmdoret, 20201009** In this notebook, I compare the nucleotide composition and general features of A.castallanii genes with HGT candidates. I previously computed the following genome composition metrics in 1kb non-overlapping sliding windows: * GC content $\frac{G+C}{A+C+G+T}$ * GC...
github_jupyter
# Project: Create a Convolutional Neural Network - We will create a model on the [CIFAR-10 dataset](https://www.cs.toronto.edu/%7Ekriz/cifar.html) ### Step 1: Import libraries ``` import tensorflow as tf from tensorflow.keras import datasets, layers, models from tensorflow.keras.models import Sequential from tensorfl...
github_jupyter
# K Nearest Neighbors Classifiers So far we've covered learning via probability (naive Bayes) and learning via errors (regression). Here we'll cover learning via similarity. This means we look for the datapoints that are most similar to the observation we are trying to predict. #### What type of model is k-nearest ne...
github_jupyter
# COVID-19: Healthcare Facility Capacity Optimization ## Objective and Prerequisites This COVID-19 Healthcare Facility Capacity Optimization problem shows you how to determine the optimal location and capacity of healthcare facilities in order to: * Satisfy demand from COVID-19 patients for treatment, * Minimize the...
github_jupyter
### MEDC0106: Bioinformatics in Applied Biomedical Science <p align="center"> <img src="../../resources/static/Banner.png" alt="MEDC0106 Banner" width="90%"/> <br> </p> --------------------------------------------------------------- # 11 - Introduction to Biopython - Proteins *Written by:* Mateusz Kaczyński **...
github_jupyter
# Proyecto - Calculadora ## **Programación** ### *Universidad Central* ### *Elaborado por:* * Juan Castillo (Interfaz gráfica, Cálculo Vectorial) * Laura Contreras (Pre-Álgebra, gráficas) * Carlos Carvajales (Cálculo diferencial) * Jessica Santos (Álgebra lineal) * María García (Cálculo Integral) Querido usuario,...
github_jupyter
<a href="https://colab.research.google.com/github/VinACE/san_mrc/blob/master/longformer_qa_training.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Longformer for Question Answering ``` !nvidia-smi !git clone https://github.com/huggingface/transf...
github_jupyter
# Autobatching log-densities example This notebook demonstrates a simple Bayesian inference example where autobatching makes user code easier to write, easier to read, and less likely to include bugs. Inspired by a notebook by @davmre. ``` from __future__ import absolute_import from __future__ import division from _...
github_jupyter
# 通过PYNQ加速OPENCV函数(Sobel算子) 在阅读本部分UserGuide时,请确认已做好以下准备: * 已经按照之前的预备文档安装好依赖环境<br> * 2根HDMI传输线(对输入视频流以及输出视频流进行测试) * 一台支持HDMI的显示器(对输入视频流以及输出视频流进行测试) ## 步骤1:加载cv2pynq库 ``` import cv2pynq as cv2 ``` 在正常运行的情况下,可以看到PYNQ板卡标记为“DONE”的LED闪烁(为加载了bit文件的效果); 这是由于在封装的时候,我们在初始化阶段调用了Overlay方法给PYNQ加载了定制的bit文件: ```python def __i...
github_jupyter
# Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone your intuitions about deep learning....
github_jupyter
# Image Data Storage for the Web ## Learning objectives - Become familiar with the design of modern, **cloud storage systems** - Gain experience with the **zarr** and **n5 formats** - Understand the relationship between **chunked, compressed**, object storage and **parallel processing and multi-scale visualization** ...
github_jupyter
This example shows how to create a radial profile from a SOXS event file, including using an exposure map to get flux-based quantities. We'll simulate a simple isothermal cluster. ``` import matplotlib matplotlib.rc("font", size=18) import matplotlib.pyplot as plt import soxs import astropy.io.fits as pyfits ``` Firs...
github_jupyter
**Chapter 5 – Support Vector Machines** _This notebook contains all the sample code and solutions to the exercises in chapter 5._ <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml/blob/master/05_support_vector_machines.ipynb"><img src="https://www.tens...
github_jupyter
``` import numpy as np import pandas as pd import torch import torchvision from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from matplotlib import pyplot as plt %matplotlib inline from scipy.st...
github_jupyter
``` # test the nn pipeline import sys sys.path.insert(0,"/Users/rezaie/github/DESILSS") import NN %matplotlib inline import matplotlib.pyplot as plt import numpy as np from sklearn.model_selection import KFold def split2Kfolds(data, k=5, shuffle=True, random_seed=123): ''' split data into k randomly chosen ...
github_jupyter
## Coming soon in `numba` 0.34 You can install the release candidate as of 07/09/2017 from the `numba` conda channel ``` conda install -c numba numba ``` ``` import numpy from numba import njit ``` Define some reasonably expensive operation in a function. ``` def do_trig(x, y): z = numpy.sin(x**2) + numpy.cos(...
github_jupyter
``` from __future__ import print_function import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.graphics.api import qqplot %matplotlib inline dta=[10930,10318,10595,10972,7706,6756,9092,10551,9722,10913,11151,8186,6422, 6337,11649,...
github_jupyter
# Deming Regression ------------------------------- This function shows how to use TensorFlow to solve linear Deming regression. $y = Ax + b$ We will use the iris data, specifically: y = Sepal Length and x = Petal Width. Demming regression is also called total least squares, in which we minimize the shortest dista...
github_jupyter
# Test of widgets * lets see what we got here ``` # try the following: #!pip install ipywidgets==7.4.2 #!pip install bqplot # lets import our usual stuff import pandas as pd import bqplot import numpy as np import traitlets import ipywidgets %matplotlib inline data = np.random.random((10, 10)) # now add scales - col...
github_jupyter
TSG098 - Get BDC replicasets (Kubernetes) ========================================= Description ----------- Steps ----- ### Common functions Define helper functions used in this notebook. ``` # Define `run` function for transient fault handling, suggestions on error, and scrolling updates on Windows import sys imp...
github_jupyter