text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Text generation with Pretrained GPT2 models from Hugging Face on Amazon SageMaker ## The Poetry of NLP You’ve just been hired by the Chicago Tribune to start a new poetry column. Congrats! The catch? You need to write a new poem every day. And it can’t just be any old string of syllables, you need it to be fresh, au...
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> # **Data Visualization Lab** Estimated time needed: **45 to 60** minutes In this assignment you will be focusing on the visualiz...
github_jupyter
# <div align="center">8.3 Basic Algorithms</div> --------------------------------------------------------------------- you can Find me on Github: > ###### [ GitHub](https://github.com/lev1khachatryan) We have previously introduced the gradient descent algorithm that follows the gradient of an entire training set down...
github_jupyter
# Medical Tests This notebook is part of [Bite Size Bayes](https://allendowney.github.io/BiteSizeBayes/), an introduction to probability and Bayesian statistics using Python. Copyright 2020 Allen B. Downey License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org...
github_jupyter
``` import tensorflow as tf print(tf.__version__) !pip install keras-tuner import kerastuner from kerastuner.tuners import RandomSearch, Hyperband, BayesianOptimization from tensorflow.keras.utils import to_categorical from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Conv2D from ...
github_jupyter
``` # https://docs.aws.amazon.com/machine-learning/latest/dg/model-fit-underfitting-vs-overfitting.html # Bir makina öğrenmesi modelinin, eğitim verisi üzerindeki başarı performansı düşük ise UNDERFITTING, # Bir makina öğrenmesi modelinin, eğitim verisi üzerindeki başarı performansı yüksek ise OVERFITTING # UNDERFITTIN...
github_jupyter
<a href="https://colab.research.google.com/github/PacktPublishing/Machine-Learning-for-Time-Series-with-Python/blob/master/chapter10/Time_Series_with_Deep_Learning.ipynb" target="_parent\"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # from https://github.com/FinYan...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import tensorflow as tf import seaborn as sns from IPython.display import YouTubeVideo import matplotlib.pyplot as plt import plotly.plotly as py import os from glob import glob from tqdm import tqdm ``` Let'...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Intro" data-toc-modified-id="Intro-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Intro</a></span></li><li><span><a href="#Run-Test-Simulation" data-toc-modified-id="Run-Test-Simulation-2"><span class="t...
github_jupyter
# Social Network Analysis of a Company Email Network This assignment involves working with a company's email network where each node represents an employee of the company, and each edge denotes that at least one email has been sent between two employees. The email network also consists of node attributes `Department` ...
github_jupyter
# Bingo Tutorial 1: One Max Problem ## Goal: Find a list with all 1 values through genetic optimization This example walks through the general steps needed to set up and run a bingo analysis. The example problem described here is the one max problem. In the one max problem individuals in a population are defined by ...
github_jupyter
# NOTE: THIS NOTEBOOK RUNS FOR 30+ MINUTES. # PLEASE BE PATIENT # Train a Model with SageMaker Autopilot We will use Autopilot to predict the star rating of customer reviews. Autopilot implements a transparent approach to AutoML. For more details on Autopilot, have a look at this [**Amazon Science Publication**...
github_jupyter
``` #Todas las librerías para los distintos algoritmos from sklearn.naive_bayes import GaussianNB from sklearn.naive_bayes import ComplementNB from sklearn.naive_bayes import BernoulliNB from sklearn.naive_bayes import MultinomialNB from sklearn.calibration import CalibratedClassifierCV from sklearn.svm import LinearSV...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Task" data-toc-modified-id="Task-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Task</a></span></li><li><span><a href="#Method" data-toc-modified-id="Method-2"><span class="toc-item-num">2&nbsp;&nbsp;</s...
github_jupyter
# Transfer Learning Tutorial Sources: - [cs231n @ Stanford](https://cs231n.github.io/transfer-learning/) - [Sasank Chilamkurthy](https://chsasank.github.io) Quote [cs231n @ Stanford](https://cs231n.github.io/transfer-learning/): In practice, very few people train an entire Convolutional Network from scratch (with...
github_jupyter
``` from scipy import fft from scipy import signal as sig import matplotlib.pyplot as plt import numpy as np import pandas as pd import math from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() import warnings warnings.simplefilter('ignore') # Read & prep data df = pd.read_csv('...
github_jupyter
## "Housing Insecurity DataDive: eviction rates for years 2017, 1018, 2019 in NYC #### ide.michelle@gmail.com, github: mishide ``` import pandas as pd import seaborn as sns # Read in processed data nyc_ts_processed = pd.read_csv("../../data/processed/nyc_processed_timeseries_2017_to_2019_20210225.csv") ``` #### (NYC...
github_jupyter
# Classes Everything in Python is an object, and every object has a type. We can create our own types in Python by defining classes. A class is declared as follows: ```python class ClassName: class body ``` Let's define the simplest class we can: ``` class FirstClass: pass ``` `pass` in python means do no...
github_jupyter
# Clustering Consulting Project - Solutions A large technology firm needs your help, they've been hacked! Luckily their forensic engineers have grabbed valuable data about the hacks, including information like session time,locations, wpm typing speed, etc. The forensic engineer relates to you what she has been able to...
github_jupyter
``` !pip install deepr[cpu] ``` # Pipeline This notebook builds upon the model defined in the [quickstart](quickstart.ipynb). The goal of this notebook is to define a full pipeline that not only trains the model, but also builds the dataset, and run this pipeline on a yarn cluster. We'll see how to 1. Define a cus...
github_jupyter
# 3.2 Skills/Wrangling In this notebook, we will focus on two essential skills in data analysis: 1. The ability to add select, aggregate and transform data in a dataframe (**part 1**) 2. The ability to get insights about a dataset by means of plotting and summary statistics (**part 2**) ## Part 1 ### Imports ``` i...
github_jupyter
# Working with Time Series ``` from datetime import datetime datetime(year=2015, month=7, day=4) from dateutil import parser date = parser.parse("4th of July, 2015") date date.strftime('%A') import numpy as np date = np.array('2015-07-04', dtype=np.datetime64) date date + np.arange(12) np.datetime64('2015-07-04') np.d...
github_jupyter
``` # https://colab.research.google.com/drive/1tTiOgJ7xvy3sjfiFC9OozbjAX1ho8WN9?usp=sharing import os import zipfile import shutil import urllib.request import logging import lzma import json import matplotlib.pyplot as plt import numpy as np import pandas as pd import time import tensorflow as tf from transformers i...
github_jupyter
<img src="../artworks/matchzoo-logo.png" alt="logo" style="width:600px;float: center"/> # MatchZoo Quick Start ``` import matchzoo as mz print(mz.__version__) ``` ## Define Task There are two types of tasks available in MatchZoo. `mz.tasks.Ranking` and `mz.tasks.Classification`. We will use a ranking task for this ...
github_jupyter
# Part 2.2 - Train Final XGBoost model Use the final training and testing data sets, containing statistical features and embedded timeseries features, to train an XGBoost classifier. ``` import cudf as gd import pandas as pd import numpy as np import math import xgboost as xgb import seaborn as sns from termcolor impo...
github_jupyter
# Task3. Enzyme Commission Number Assignment > author: Shizhenkun > email: zhenkun.shi@tib.cas.cn > date: 2021-10-21 ## 1. Import packages ``` import numpy as np import pandas as pd import sys import os from tqdm import tqdm sys.path.append("../tools/") import funclib import time from xgboost.sklearn import XG...
github_jupyter
# Synthesis ## Setup ``` import synpuf import pandas as pd INFILE = '~/puf2011.csv' OUTFILE = '~/Downloads/syntheses/synpuf20.csv' SEED_COLS = ['MARS', 'S006', 'E00100', 'E04600', 'P04470', 'E04800', 'E62100', 'E05800', 'E08800', 'E59560', 'E26190'] AGG_RECIDS = [999996, 999997, 999998, 999999] COL_ORDER...
github_jupyter
# Softmax exercise *Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.* This exercise is ...
github_jupyter
# Preliminaries The `pandas` library allows the user several data structures for different data manipulation tasks: 1. Data storage through its `Series` and `DataFrame` data structures. 2. Data filtering using multiple methods from the package. 3. Reading data from many different file formats such as `csv`, `txt`, `xl...
github_jupyter
``` %matplotlib inline ``` # Fit a ridge model with motion energy features In this example, we model the fMRI responses with motion-energy features extracted from the movie stimulus. The model is a regularized linear regression model. This tutorial reproduces part of the analysis described in Nishimoto et al (2011)...
github_jupyter
<a href="https://colab.research.google.com/github/Shantanu9326/Data-Science-Portfolio/blob/master/Avocado_Prices_Prediction.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # PREDICTING AVOCADO PRICES USING FACEBOOK PROPHET # By Shantanu Gupta # ST...
github_jupyter
# **StarDist (2D)** --- <font size = 4>**StarDist 2D** is a deep-learning method that can be used to segment cell nuclei from bioimages and was first published by [Schmidt *et al.* in 2018, on arXiv](https://arxiv.org/abs/1806.03535). It uses a shape representation based on star-convex polygons for nuclei in an image ...
github_jupyter
[Jean-Nicholas Hould](http://www.jeannicholashould.com/python-web-scraping-tutorial-for-craft-beers.html) ``` %load_ext watermark %watermark -u -v -d -p urllib,bs4,re,pandas ``` # Craft Beer & Data Science - Part 1 - Scraping for Craft Beers If you have read some of my posts in the past, you know by now that I enjoy...
github_jupyter
# Bi-LSTM on IMDB ## Librairies ``` # !pip install transformers==4.8.2 # !pip install datasets==1.7.0 import os import sys import time import pickle import torch import torch.nn as nn import torch.optim as optim from datasets import load_dataset, Dataset, concatenate_datasets from transformers import AutoTokenizer f...
github_jupyter
![ ](https://www.pon-cat.com/application/files/7915/8400/2602/home-banner.jpg) # <center> **Визуализация данных** </center> Визуализация занимает важную часть в анализе данных. Представляя информацию в графическом виде, вы облегчаете процесс ее восприятия, что дает возможность выделять дополнительные закономерности, ...
github_jupyter
# Marginal, Joint, and Conditional Probability Venn Diagrams This notebook creates two events, and calculates the marginal, joint, and conditional probabilities of both events from random samples in the feature space. ``` import pandas as pd import matplotlib.pyplot as plt import numpy as np %matplotlib inline ``` ...
github_jupyter
<a name="corpus-preprocessing"></a> # N-grams Corpus preprocessing The input corpus in this week's assignment is a continuous text that needs some preprocessing so that you can start calculating the n-gram probabilities. Some common preprocessing steps for the language models include: - lowercasing the text - remove ...
github_jupyter
# Hello Feature Class example: using the feature classes to calculate features This example shows how to use the Radiomics package to directly instantiate the feature classes for feature extraction. Note that this is not the intended standard use. For an example on the standard use with feature extractor, see the `he...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import torch %matplotlib inline device = torch.device("cuda" if torch.cuda.is_available() else "cpu") ``` ## Neural Process for 1D functions This notebook shows how to train and sample from a Neural Process for a simple class of 1D functions. The functions are d...
github_jupyter
# Data feed (optional) Using a notebook to feed data into Event Store is now optional for this code pattern. Instead, you should use IBM Streams to feed the data. If you are not using IBM Streams, you can run this notebook as an alternative. In this notebook, a CSV file is read into a pandas DataFrame which is then u...
github_jupyter
![Astrofisica Computacional](../logo.png) --- ## 22. Multilinear Fit with SciKit-Learn. Example 3 Eduard Larrañaga (ealarranaga@unal.edu.co) --- ### About this notebook In this worksheet, we will use the `scikit-learn` package split a sample database of 88 supermassive black holes into train and test sets in orde...
github_jupyter
# Homework 0: Python fundamentals [Kaggle](https://www.kaggle.com/) is a data science platform that has various [tutorials](https://www.kaggle.com/learn/overview) and [competitions](https://www.kaggle.com/competitions), which you may want to go back to later. You are welcome to create a Kaggle account to save your pro...
github_jupyter
# Doom Deadly Corridor with Advantage Actor Critic The purpose of this scenario is to teach the agent to navigate towards his fundamental goal (the vest) and make sure he survives at the same time. ### Enviroment Map is a corridor with shooting monsters on both sides (6 monsters in total). A green vest is placed at th...
github_jupyter
<a href="https://colab.research.google.com/github/unica-ml/ml/blob/master/notebooks/lab05.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Machine Learning - Lab05 ## Neural Networks with PyTorch This notebook provides a brief introduction to PyT...
github_jupyter
# Collection of Helpful Functions for [Class](https://sites.wustl.edu/jeffheaton/t81-558/) This is a collection of helpful functions that I will introduce during this course. ``` import base64 import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import requests from sklearn import preproc...
github_jupyter
[![pythonista](img/pythonista.png)](https://www.pythonista.io) # Tipado estricto con *Python*. ## Pistas de tipo (*type hints*). https://www.python.org/dev/peps/pep-0483/ Los indicadores de tipo son sintácticamente válidos, pero el intérpete de *Python* no los toma en cuenta. ### Indicadores para asignación de no...
github_jupyter
___ <a href='http://www.pieriandata.com'> <img src='../../Pierian_Data_Logo.png' /></a> ___ # Matplotlib Exercises Welcome to the exercises for reviewing matplotlib! Take your time with these, Matplotlib can be tricky to understand at first. These are relatively simple plots, but they can be hard if this is your fir...
github_jupyter
# Creating a Siamese model using Trax: Ungraded Lecture Notebook ``` import trax from trax import layers as tl import trax.fastmath.numpy as np import numpy # Setting random seeds trax.supervised.trainer_lib.init_random_number_generators(10) numpy.random.seed(10) ``` ## L2 Normalization Before building the model yo...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import scipy.optimize as sopt from pysimu import ode2numba, ssa from ipywidgets import * import numba %matplotlib notebook import vsg_pi_wz syst = vsg_pi_wz.vsg_pi_wz_class() run = vsg_pi_wz.run ``` ## System definition ``` x0 = np.ones(syst.N_x+syst.N_y) x0[0]...
github_jupyter
# Gradient Checking Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking. You are part of a team working to make mobile payments available globally, and are asked to build a deep learning model to detect fraud--whenever someone makes a payment, you w...
github_jupyter
# Maps of RMSSSH ``` import dask import dask.threaded import dask.multiprocessing from dask.distributed import Client c = Client() c ``` ## 0. Modules and libraries ``` import warnings warnings.filterwarnings("ignore") import os import time import glob import numpy as np import xarray as xr import time import ...
github_jupyter
# Template for how the legacypipe/Tractor pipeline is setup and run on DECam data ## Modify accordingly for PTF, ZTF, etc. ### Python Stack * At NERSC do the following. This uses Ted Kisner's conda build for DESI imaging code then copies everything to your scratch so you can do "conda install ..." for any extra packa...
github_jupyter
``` %matplotlib inline # ignore warnings from copy import deepcopy import warnings warnings.filterwarnings('ignore') from joblib import load from ruamel.yaml import YAML from matplotlib import pyplot as plt import seaborn as sns import numpy as np import pandas as pd import h5py from sklearn.metrics import mean_squa...
github_jupyter
# HyperLearning AI - Introduction to Python An introductory course to the Python 3 programming language, with a curriculum aligned to the Certified Associate in Python Programming (PCAP) examination syllabus (PCAP-31-02).<br/> https://knowledgebase.hyperlearning.ai/courses/introduction-to-python ## 02. Control and Ev...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D2_ModelingPractice/W1D2_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neuromatch Academy: Week 1, Day 2, Tutorial 2 # Modeling ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt # 通过一个列表的值创建一个系列,让pandas创建一个默认的整数索引: s = pd.Series([1,3,5,np.nan,6,8]) s # 注意:np.nan表示不存在 # 通过numpy创建的数组,可以创建一个pandas中特有的dataframe,使用datetime作为索引和标记列名。 dates = pd.date_range('20130101', periods=6) dates # 这里的date_range()是pandas下的一个方法,可以在jupyter...
github_jupyter
# Deep Learning Explained # Module 3 - Lab - Introduction to Deep Neural Networks ## 1.0 Overview This lesson introduces you to the basics of neural network architecture in the form of deep forward networks. This architecture is the quintessential deep neural net architecture. In this lab you will learn the followi...
github_jupyter
This notebook contains code for computing mean fields for GE TOPUP, GE EPIC, SE TOPUP and SE EPIC and saving them to file. 1. Specify epi_corrections output directory ``` output_directory_suffix = "2019_07_02" # On local file system: corrections_base_directory = "../../epi_corrections_out_" + output_directory_suffix ...
github_jupyter
<a href="https://colab.research.google.com/github/RL-Starterpack/rl-starterpack/blob/main/exercises/PG.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # RL Tutorial - **Policy Gradient Exercise** ## Setup ``` #@title Run this cell to clone the RL ...
github_jupyter
# YOLO v3 Finetuning on AWS This series of notebooks demonstrates how to finetune pretrained YOLO v3 (aka YOLO3) using MXNet on AWS. **This notebook** guides you on how to deploy the YOLO3 model trained in the previous module to the SageMaker endpoint using CPU instance. **Follow-on** the content of the notebooks sh...
github_jupyter
# Blind Source Separation on Images with Shogun #### by Kevin Hughes This notebook illustrates <a href="http://en.wikipedia.org/wiki/Blind_signal_separation">Blind Source Seperation</a>(BSS) on images using <a href="http://en.wikipedia.org/wiki/Independent_component_analysis">Independent Component Analysis</a> (ICA) ...
github_jupyter
*This example is a Jupyter notebook. You can download it or run it interactively on mybinder.org.* # Linear regression ## Data The true parameters of the linear regression: ``` import numpy as np k = 2 # slope c = 5 # bias s = 2 # noise standard deviation # This cell content is hidden from Sphinx-generated document...
github_jupyter
# Testing Distributions <div class="alert alert-success"> Sometimes it may be useful (or necessary) to formally test whether some data you observe follows a particular distribution. </div> Perhaps most commonly, if you are using statistical tests that assume data to have a particular distribution, you need to test wh...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.neural_network import MLPClassifier from sklearn.ensemble import BaggingClassifier basePre = pd.read_csv('./bases/base_pre.csv') baseScaled = pd.read_csv('...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importar el data set dataset = pd.read_csv('./Section 17 - Kernel SVM/Social_Network_Ads.csv') X = dataset.iloc[:, [2,3]].values y = dataset.iloc[:, 4].values dataset #Dividir el data set en conjunto de entrenamiento y conjunto de test...
github_jupyter
# [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/cene555/ruCLIP-SB/blob/main/notebooks/evaluate_ruCLIP_SB_latest.ipynb) ``` #@title Allowed Resources import multiprocessing import torch from psutil import virtual_memory ram_gb = round(virtual_memo...
github_jupyter
``` # See http://stackoverflow.com/questions/27004422/contour-imshow-plot-for-irregular-x-y-z-data %pylab inline import scipy as sp pylab.rcParams['figure.figsize'] = (10.0, 8.0) def get_grid(x_limits, y_limits, step=.01): return np.meshgrid(np.arange(*x_limits, step=step), np.arange(*y_limit...
github_jupyter
<center> <img src="http://sct.inf.utfsm.cl/wp-content/uploads/2020/04/logo_di.png" style="width:60%"> <h1> INF-495 - Modelado Computacional Aplicado </h1> <h2> Prof. Claudio Torres, Ph.D. </h2> <h2> Version: 1.02</h2> </center> ## Textbook: Computational Mathematical Modeling, An Integrated Approach Ac...
github_jupyter
# Genetic search approach ``` import numpy as np np.random.seed(420) train_X = np.load('../data/train_X.npy') train_y = np.load('../data/train_y.npy') valid_X = np.load('../data/valid_X.npy') valid_y = np.load('../data/valid_y.npy') N = 1500 # dataset size T = 16 # number of datasets per generation M = 0.2 # fracti...
github_jupyter
``` from sqlalchemy import create_engine from __future__ import division from pyomo.environ import * from pyomo.opt import SolverFactory import time as tm import googlemaps import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import ast # Conventions for naming model components: # SETS_ALL...
github_jupyter
# Chapter 1: L3 Technologies ## Admin Distance * Belivability of a routing advertisement | AD | Routing Source | |---| ---| |0 | Connected | |1 | Static (default) | |20| eBGP | |90| Internal EIGRP (D) | |110 | OSPF | |115 | IS-IS | |120 | RIP | |170 | External EIGRP (D EX) | |200 | iBGP| |255 | Static default over...
github_jupyter
<a href="https://colab.research.google.com/github/google/jax-md/blob/main/notebooks/nve_neighbor_list.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title Imports & Utils !pip install jax-md import numpy as onp from jax.config import confi...
github_jupyter
# Convolutional Networks So far we have worked with deep fully-connected networks, using them to explore different optimization strategies and network architectures. Fully-connected networks are a good testbed for experimentation because they are very computationally efficient, but in practice all state-of-the-art resu...
github_jupyter
# Systems Numerous dynamic systems are implemented in Underworld. They may be found within the `systems` submodule. For specific information on the different system classes, the user is directed to the API reference available at the Underworld documentation site: [http://underworld2.readthedocs.io/](http://underworl...
github_jupyter
# What is probability? A simulated introduction ``` #Import packages import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline sns.set() ``` ## Learning Objectives of Part 1 - To have an understanding of what "probability" means, in both Bayesian and Frequentist ...
github_jupyter
In this topic, we will use the metric **"Silhouette Coefficient score "** which computes the average of the **Silhouette Coefficient** of all examples in the dataset. http://scikit-learn.org/stable/modules/clustering.html#silhouette-coefficient Indeed, when the "ground truth" or when the labels are unknown, we need to...
github_jupyter
# 3D U-Net on BraTS glioma dataset ``` %reload_ext rpy2.ipython import os import argparse import datetime import numpy as np from tqdm import tqdm import mxnet as mx from mxnet import gluon, autograd, ndarray as nd from mxnet.gluon.utils import split_and_load from unet import * ``` *** ## Setup hyperparameters ``...
github_jupyter
##### Copyright 2019 Google LLC. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title License # 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...
github_jupyter
# Quantum Circuit Properties ``` from qiskit import * %matplotlib inline ``` ## Introduction <a name='introduction'></a> When constructing quantum circuits, there are several properties that help quantify the "size" of the circuits, and their ability to be run on a noisy quantum device. Some of these, like number o...
github_jupyter
# Propriedade da multiplicação e janelas Imagine que você tenha um fenômeno (ou sinal) com duração infinita, $x(t)$, que deseja observar (medir). Quando medimos $x(t)$ por um tempo finito estamos observando o fenômeno por uma janela temporal $w(t)$ finita. Na prática, o sinal observado é: \begin{equation} x_o(t) = x...
github_jupyter
``` # # Caso ja não tenha instalado, instale os seguintes pacotes: # !pip install cmake # !pip install xgboost # !pip install sklearn # !pip install sklearn-deap # # (para usar o EvolutionarySearch >> https://github.com/rsteca/sklearn-deap) # !pip install scikit-plot import multiprocessing print(multiprocessing.cpu...
github_jupyter
<div class="contentcontainer med left" style="margin-left: -50px;"> <dl class="dl-horizontal"> <dt>Title</dt> <dd> Bivariate Element</dd> <dt>Dependencies</dt> <dd>Matplotlib, SciPy</dd> <dt>Backends</dt> <dd><a href='./Bivariate.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/Bivariate.ipynb'>Bokeh</a></dd> </d...
github_jupyter
# Regression and Other Stories: Chapter 6 ``` import arviz as az from bambi import Model import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy import stats # R is one indexed x = np.arange(1, 21) n = x.shape a = .2 b = .3 sigma = .5 y = a + b*x + sigma*stats.norm().rvs(n) fake = pd.DataFram...
github_jupyter
``` %matplotlib inline %reload_ext autoreload %autoreload 2 from resources.conv_learner import * import os from pathlib import Path from os.path import basename import pickle test_dir = "datasets/yeast_v4/" data_path = Path(test_dir) # calculate test_dirs , train_dirs = [], [] for ds_dir in data_path.iterdir(): if...
github_jupyter
# Start kit for Task 1 - Sleep stage decoding transfer learning challenge We recommand you to read the 'LeaderboardDataGuide' and visit the https://beetl.ai to get familar with data and tasks before you read this start kit. <p> &#10071; <b>Important</b> &#10071; </p> For the competition, please MAKE SURE that your mo...
github_jupyter
##De-identification in Spark OCR ####0 Import libs ``` import os import matplotlib.pyplot as plt from pyspark.ml import Pipeline, PipelineModel import sparknlp import sparknlp_jsl from sparknlp.base import * from sparknlp.util import * from sparknlp.annotator import * from sparknlp_jsl.base import * from sparknlp_js...
github_jupyter
``` import numpy as np import pandas as pd import sklearn.neighbors import sklearn.model_selection import sklearn.datasets import sklearn.manifold import sklearn.decomposition def score_embedding(data, labels, k=10, n_neighbors=5, random_state=42): model = sklearn.neighbors.KNeighborsClassifier(n_neighbors=n_neighb...
github_jupyter
# Optical Character Recognition ![A robot reading a newspaper](./images/ocr.jpg) A common computer vision challenge is to detect and interpret text in an image. This kind of processing is often referred to as *optical character recognition* (OCR). ## Use the Computer Vision Service to Read Text in an Image The **Co...
github_jupyter
# Transfer Learning In this notebook, you'll learn how to use pre-trained networks to solved challenging problems in computer vision. Specifically, you'll use networks trained on [ImageNet](http://www.image-net.org/) [available from torchvision](http://pytorch.org/docs/0.3.0/torchvision/models.html). ImageNet is a m...
github_jupyter
# Introduction to scikit-learn: basic model hyper-parameters tuning The process to learn a predictive model is driven by a set of internal parameters and a set of training data. These internal parameters are called hyper-parameters and are specific for each family of models. In addition, a set of parameters are optima...
github_jupyter
# Ready, Steady, Go AI (*Tutorial*) This tutorial is a supplement to the paper, **Ready, Steady, Go AI: A Practical Tutorial on Fundamentals of Artificial Intelligence and Its Applications in Phenomics Image Analysis** (*Patterns, 2021*) by Farid Nakhle and Antoine Harfouche Read the accompanying paper [here](https:/...
github_jupyter
# Matrix Factorisation - Implicit Implicit Matrix Factorization - Where ratings of less than threshold are implied as preferences - Also uses negative sampling to improve performance ``` import sys sys.path.append("../") import warnings warnings.filterwarnings("ignore") import numpy as np import pandas as pd from ...
github_jupyter
# Libraries ``` # @author: innat import os, warnings os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' warnings.filterwarnings("ignore") import tensorflow as tf physical_devices = tf.config.list_physical_devices('GPU') try: tf.config.experimental.set_memory_growth(physical_devices[0], True) tf.config.optimizer.set_j...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/ylongqi/openrec/blob/master/tutorials/OpenRec_Tutorial_1.ipynb) Get Started --- by *[Longqi@Cornell](http://www.cs.cornell.edu/~ylongqi)* licensed under [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/...
github_jupyter
# Targeting Direct Marketing with Features Store and Amazon SageMaker XGBoost _**Supervised Learning with Gradient Boosted Trees: A Binary Prediction Problem With Unbalanced Classes**_ --- --- ## Contents 1. [Background](#Background) 1. [Prepration](#Preparation) 1. [Data](#Data) 1. [Exploration](#Exploration) ...
github_jupyter
``` import tensorflow as tf import datetime, os # hide tf logs os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # or any {'0', '1', '2'}, # 0 (default) shows all, 1 to filter out INFO logs, 2 to additionally filter out WARNING logs, and 3 to additionally filter out ERROR logs import scipy.optimize import scipy.io import numpy...
github_jupyter
# Module 3 Assignment Your objective in this assignment is to implement a tennis ball detector using a pre-trained image classification network from GluonCV. We'll step through the pipeline, from loading and transforming an input image, to loading and using a pre-trained model. Since we're only interested in detecting...
github_jupyter
``` import pandas as pd ``` # Read data ``` pop = pd.read_csv('/Users/julianeoliveira/Desktop/github/Datasets from the gitcomputations/Populacao/pop.csv') cod_ibge_uf = pd.read_csv('/Users/julianeoliveira/Desktop/github/Datasets from the gitcomputations/IBGE_geocode_states.csv', \ sep=';', he...
github_jupyter
# The Physics of Sound, Part I [return to main page](index.ipynb) ## Preparations For this exercise we need the [Sound Field Synthesis Toolbox for Python](http://python.sfstoolbox.org); ``` import sfs # tested for 0.5.0 ``` And some other stuff: ``` # remove "inline" to get a separate plotting window: from numpy...
github_jupyter
# Date Converter We will be translating from one date format to another. In order to do this we need to connect two set of LSTMs (RNNs). The diagram looks as follows: Each set respectively sharing weights (i.e. each of the 4 green cells have the same weights and similarly with the blue cells). The first is a many to o...
github_jupyter