text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Improve accuracy of pdf batch processing with Amazon Textract and Amazon A2I In this chapter and this accompanying notebook learn with an example on how you can use Amazon Textract in asynchronous mode by extracting content from multiple PDF files in batch, and sending specific content from these PDF documents to an...
github_jupyter
import modules and get command-line parameters if running as script ``` from probrnn import models, data, inference import numpy as np import json from matplotlib import pyplot as plt from IPython.display import clear_output ``` parameters for the model and training ``` params = \ { "N_ITERATIONS": 10 *...
github_jupyter
# Inference and Validation Now that you have a trained network, you can use it for making predictions. This is typically called **inference**, a term borrowed from statistics. However, neural networks have a tendency to perform *too well* on the training data and aren't able to generalize to data that hasn't been seen...
github_jupyter
# Point Spread Function Photometry with Photutils The PSF photometry module of photutils is intended to be a fully modular tool such that users are able to completly customise the photometry procedure, e.g., by using different source detection algorithms, background estimators, PSF models, etc. Photutils provides impl...
github_jupyter
# 🦌 RuDOLPH 350M <b><font color="white" size="+2">Official colab of [RuDOLPH: One Hyper-Modal Transformer can be creative as DALL-E and smart as CLIP](https://github.com/sberbank-ai/ru-dolph)</font></b> <font color="white" size="-0.75."><b>RuDOLPH</b> is a fast and light text-image-text transformer (350M GPT-3) for...
github_jupyter
# Quantitative omics The exercises of this notebook correspond to different steps of the data analysis of quantitative omics data. We use data from transcriptomics and proteomics experiments. ## Installation of libraries and necessary software Copy the files *me_bestprobes.csv* and _AllQuantProteinsInAllSamples.csv_...
github_jupyter
<table><tr> <td style="background-color:#ffffff;text-align:left;"><a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="30%" align="left"></a></td> <td style="background-color:#ffffff;">&nbsp;</td> <td style="background-color:#ffffff;vertical-align:text-middle;text-align:righ...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive', force_remount=True) cd 'drive/My Drive/Colab Notebooks/machine_translation' from dataset import MTDataset from model import Encoder, Decoder from language import Language from utils import preprocess from train import train from eval import validate from ...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Mathematics/FractionMultiplication/Frac...
github_jupyter
# 1 - Sequence to Sequence Learning with Neural Networks In this series we'll be building a machine learning model to go from once sequence to another, using PyTorch and torchtext. This will be done on German to English translations, but the models can be applied to any problem that involves going from one sequence to...
github_jupyter
# mlforecast > Scalable machine learning based time series forecasting. **mlforecast** is a framework to perform time series forecasting using machine learning models, with the option to scale to massive amounts of data using remote clusters. [![CI](https://github.com/Nixtla/mlforecast/actions/workflows/ci.yaml/badg...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import ipywidgets as widgets from IPython.display import HTML from datetime import datetime # General import os # Drawing import cartopy import matplotlib.pyplot as plt import cartopy.crs as ccrs from cartopy.io import shapereader from matplot...
github_jupyter
``` %load_ext autoreload %autoreload 2 ``` # Forecast like observations Use observation files to produce new files that fit the shape of a forecast file. That makes them easier to use for ML purposes. At the core of this task is the forecast_like_observations provided by the organizers. This notebooks loads the appro...
github_jupyter
Author: Xi Ming. ## Build a Multilayer Perceptron from Scratch based on PyTorch. PyTorch's automatic differentiation mechanism can help quickly implement multilayer perceptrons. ### Import Packages. ``` import torch import torchvision import torch.nn as nn from torchvision import datasets,transforms from torch.util...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' os.system('rm -rf tacotron2-female-alignment') os.system('mkdir tacotron2-female-alignment') import tensorflow as tf import numpy as np from glob import glob import tensorflow as tf import malaya_speech import malaya_speech.train from malaya_speech.train.model imp...
github_jupyter
``` import numpy as np import cvxpy as cp import networkx as nx import matplotlib.pyplot as plt # Problem data reservations = np.array([110, 118, 103, 161, 140]) flight_capacities = np.array([100, 100, 100, 150, 150]) cost_per_hour = 50 cost_external_company = 75 # Build transportation grah G = nx.DiGraph() # Add node...
github_jupyter
``` import tempfile import urllib.request train_file = "datasets/thermostat/sample-training-data.csv" test_file = "datasets/thermostat/test-data.csv" import pandas as pd COLUMNS = ["month", "day", "hour", "min", "pirstatus", "isDay", "extTemp", "extHumidity", "loungeTemp", "loungeHumidity", "state...
github_jupyter
# Fuzzing APIs So far, we have always generated _system input_, i.e. data that the program as a whole obtains via its input channels. However, we can also generate inputs that go directly into individual functions, gaining flexibility and speed in the process. In this chapter, we explore the use of grammars to synth...
github_jupyter
``` #Copyright 2020 Vraj Shah, Arun Kumar # #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 # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in w...
github_jupyter
``` # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
github_jupyter
# Creating a class ``` class Student: # created a class "Student" name = "Tom" grade = "A" age = 15 def display(self): print(self.name,self.grade,self.age) # There will be no output here, because we are not invoking (calling) the "display" function to print ``` ##...
github_jupyter
# Linear Discriminant Analysis (LDA) ## Importing the libraries ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd ``` ## Importing the dataset ``` dataset = pd.read_csv('Wine.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, -1].values ``` ## Splitting the dataset into the Training...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Inference PyTorch Bert Model with ONNX Runtime on CPU In this tutorial, you'll be introduced to how to load a Bert model from PyTorch, convert it to ONNX, and inference it for high performance using ONNX Runtime. In the foll...
github_jupyter
``` !pip install chart_studio 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 pandas as pd df = pd.read_csv("https://raw.githubusercontent.com/DSEI21000-...
github_jupyter
``` # 加载文本分类数据集 from sklearn.datasets import fetch_20newsgroups import random newsgroups_train = fetch_20newsgroups(subset='train') newsgroups_test = fetch_20newsgroups(subset='test') X_train = newsgroups_train.data X_test = newsgroups_test.data y_train = newsgroups_train.target y_test = newsgroups_test.target print(...
github_jupyter
# MDP from multidimensional HJB see [pdf](https://github.com/songqsh/foo1/blob/master/doc/191206HJB.pdf) for its math derivation see souce code at - [py](hjb_mdp_v05_3.py) for tabular approach and - [py](hjb_mdp_nn_v05.py) for deep learning approach ``` import numpy as np import time #import ipdb import itertools...
github_jupyter
``` !nvidia-smi import sys if 'google.colab' in sys.modules: !pip install -Uqq fastcore onnx onnxruntime sentencepiece seqeval rouge-score !pip install -Uqq --no-deps fastai ohmeow-blurr !pip install -Uqq transformers datasets wandb from fastai.text.all import * from fastai.callback.wandb import * from tran...
github_jupyter
``` import pandas as pd import numpy as np from pathlib import Path dir_path = Path().resolve().parent / 'demand_patterns' low_patterns = "demand_patterns_train_low.csv" fullrange_patterns = "demand_patterns_train_full_range.csv" combined_pattern = 'demand_patterns_train_combined.csv' comb = pd.read_csv(dir_path / com...
github_jupyter
<a href="http://cocl.us/pytorch_link_top"> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DL0110EN/notebook_images%20/Pytochtop.png" width="750" alt="IBM Product " /> </a> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DL0110EN...
github_jupyter
# Configuring pandas ``` # import numpy and pandas import numpy as np import pandas as pd # used for dates import datetime from datetime import datetime, date # Set some pandas options controlling output format pd.set_option('display.notebook_repr_html', False) pd.set_option('display.max_columns', 8) pd.set_option('...
github_jupyter
Synergetics<br/>[Oregon Curriculum Network](http://4dsolutions.net/ocn/) <h3 align="center">Computing Volumes in XYZ and IVM units</h3> <h4 align="center">by Kirby Urner, July 2016</h4> ![Fig. 1](https://c1.staticflickr.com/5/4117/4902708217_451afaa8c5_z.jpg "Fig 1: Mitey Cube") A cube is composed of 24 identical no...
github_jupyter
``` !pip install yacs !pip install gdown import os, sys, time import argparse import importlib from tqdm.notebook import tqdm from imageio import imread import torch import numpy as np import matplotlib.pyplot as plt ``` ### Download pretrained - We use HoHoNet w/ hardnet encoder in this demo - Download other version ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv("test2_result.csv") df df2 = pd.read_excel("Test_2.xlsx") # 只含特征值的完整数据集 data = df2.drop("TRUE VALUE", axis=1) # 只含真实分类信息的完整数据集 labels = df2["TRUE VALUE"] # data2是去掉真实分类信息的数据集(含有聚类后的结果) data2 = df.drop("TRUE VALUE", axis=1) data...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Water/usgs_watersheds.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank...
github_jupyter
<img align="right" src="images/ninologo.png" width="150"/> <img align="right" src="images/tf-small.png" width="125"/> <img align="right" src="images/dans.png" width="150"/> # Start This notebook gets you started with using [Text-Fabric](https://github.com/Nino-cunei/uruk/blob/master/docs/textfabric.md) for coding in ...
github_jupyter
``` import zmq import msgpack import sys from pprint import pprint import json import numpy as np import ceo import matplotlib.pyplot as plt %matplotlib inline port = "5556" ``` # SETUP ``` context = zmq.Context() print "Connecting to server..." socket = context.socket(zmq.REQ) socket.connect ("tcp://localhost:%s" %...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Challenge Notebook ## Problem: Format license keys. See the [LeetCode](https://leetcode.com/problems/license-key-formatting/) problem 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
<a href="https://colab.research.google.com/github/ElizaLo/Practice-Python/blob/master/Data%20Compression%20Methods/Huffman%20Code/Huffman_code.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Huffman Coding ## **Solution** ``` import heapq from c...
github_jupyter
``` # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd import datetime dataset = pd.read_csv(r'C:\Users\ANOVA AJAY PANDEY\Desktop\SEM4\CSE 3021 SIN\proj\stock analysis\Google_Stock_Price_Train.csv',index_col="Date",parse_dates=True) dataset = pd.read_csv(r'C:\Users\ANOVA AJ...
github_jupyter
``` import os import sys import itertools import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import statsmodels.regression.linear_model as sm from scipy import io from mpl_toolkits.axes_grid1 import make_axes_locatable path_root = os.environ.get('DECIDENET_PATH') path_code...
github_jupyter
# Loading and Checking Data ## Importing Libraries ``` import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable import math import numpy as np import matplotlib.pyplot as plt %matp...
github_jupyter
## Apprentissage supervisé: Forêts d'arbres aléatoires (Random Forests) Intéressons nous maintenant à un des algorithmes les plus popualires de l'état de l'art. Cet algorithme est non-paramétrique et porte le nom de **forêts d'arbres aléatoires** ``` %matplotlib inline import numpy as np import matplotlib.pyplot as p...
github_jupyter
[Sascha Spors](https://orcid.org/0000-0001-7225-9992), Professorship Signal Theory and Digital Signal Processing, [Institute of Communications Engineering (INT)](https://www.int.uni-rostock.de/), Faculty of Computer Science and Electrical Engineering (IEF), [University of Rostock, Germany](https://www.uni-rostock.de/en...
github_jupyter
``` import os import argparse from keras.preprocessing.image import ImageDataGenerator from keras import callbacks import numpy as np from keras import layers, models, optimizers from keras import backend as K from keras.utils import to_categorical import matplotlib.pyplot as plt from utils import combine_images from P...
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 networkx as nx import numpy as np import matplotlib.pyplot as plt from functools import lru_cache from numba import jit import community import warnings; warnings.simplefilter('ignore') @jit(nopython = True) def generator(A): B = np.zeros((len(A)+2, len(A)+2), np.int_) B[1:-1,1:-1] = A for i in r...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import sys os.chdir(sys.path[0]+"/../data") import urllib.request from bs4 import BeautifulSoup import pandas as pd import re from tqdm import tqdm categories = [ "100 metres, Men", "200 metres, Men", "400 metres, Men", "800 ...
github_jupyter
``` # Jovian Commit Essentials # Please retain and execute this cell without modifying the contents for `jovian.commit` to work !pip install jovian --upgrade -q import jovian jovian.set_project('pandas-practice-assignment') jovian.set_colab_id('1EMzM1GAuekn6b3mjbgjC83UH-2XgQHAe') ``` # Assignment 3 - Pandas Data Analy...
github_jupyter
``` import numpy as np import S_Dbw as sdbw from sklearn.cluster import KMeans from sklearn.datasets.samples_generator import make_blobs from sklearn.metrics.pairwise import pairwise_distances_argmin np.random.seed(0) S_Dbw_result = [] batch_size = 45 centers = [[1, 1], [-1, -1], [1, -1]] cluster_std=[0.7,0.3,1.2] n_...
github_jupyter
``` from xml.etree import ElementTree from xml.dom import minidom from xml.etree.ElementTree import Element, SubElement, Comment, indent def prettify(elem): """Return a pretty-printed XML string for the Element. """ rough_string = ElementTree.tostring(elem, encoding="ISO-8859-1") reparsed = minidom.par...
github_jupyter
# Multi-variate Rregression Metamodel with DOE based on random sampling * Input variable space should be constructed using random sampling, not classical factorial DOE * Linear fit is often inadequate but higher-order polynomial fits often leads to overfitting i.e. learns spurious, flawed relationships between input an...
github_jupyter
# Histograms of time-mean surface temperature ## Import the libraries ``` # Data analysis and viz libraries import aeolus.plot as aplt import matplotlib.pyplot as plt import numpy as np import xarray as xr # Local modules from calc import sfc_temp import mypaths from names import names from commons import MODELS impo...
github_jupyter
# Near to far field transformation See on [github](https://github.com/flexcompute/tidy3d-notebooks/blob/main/Near2Far_ZonePlate.ipynb), run on [colab](https://colab.research.google.com/github/flexcompute/tidy3d-notebooks/blob/main/Near2Far_ZonePlate.ipynb), or just follow along with the output below. This tutorial wi...
github_jupyter
# Data Visualization The RAPIDS AI ecosystem and `cudf.DataFrame` are built on a series of standards that simplify interoperability with established and emerging data science tools. With a growing number of libraries adding GPU support, and a `cudf.DataFrame`’s ability to convert `.to_pandas()`, a large portion of th...
github_jupyter
<a href="https://colab.research.google.com/github/AWH-GlobalPotential-X/AWH-Geo/blob/master/notebooks/AWH-Geo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Welcome to AWH-Geo This tool requires a [Google Drive](https://drive.google.com/drive/my-d...
github_jupyter
# Chapter 7 ``` import arviz as az import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc3 as pm import statsmodels.api as sm import statsmodels.formula.api as smf from patsy import dmatrix from scipy import stats from scipy.special import logsumexp %config Inline.figure_format = 'retina' ...
github_jupyter
MIT License Copyright (c) 2017 Erik Linder-Norén Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
github_jupyter
# Training and hosting SageMaker Models using the Apache MXNet Gluon API When there is a person in front of you, your human eyes can immediately recognize what direction the person is looking at (e.g. either facing straight up to you or looking at somewhere else). The direction is defined as the head-pose. We are goin...
github_jupyter
# Kaggle San Francisco Crime Classification ## Berkeley MIDS W207 Final Project: Sam Goodgame, Sarah Cha, Kalvin Kao, Bryan Moore ### Environment and Data ``` # Additional Libraries %matplotlib inline import matplotlib.pyplot as plt # Import relevant libraries: import time import numpy as np import pandas as pd from...
github_jupyter
# Data Cleaning For each IMU file, clean the IMU data, adjust the labels, and output these as CSV files. ``` %load_ext autoreload %autoreload 2 %matplotlib notebook import numpy as np from sklearn.model_selection import cross_val_score from sklearn.model_selection import RepeatedStratifiedKFold from sklearn.ensembl...
github_jupyter
``` import csv import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator from google.colab import files ``` The data for this exercise is available at: https://www.kaggle.com/datamunge/sign-language-mnist/home Sign up and download to find 2 CSV files: sign_mnist_te...
github_jupyter
# Getting Started with *pyFTracks* v 1.0 **Romain Beucher, Roderick Brown, Louis Moresi and Fabian Kohlmann** The Australian National University The University of Glasgow Lithodat *pyFTracks* is a Python package that can be used to predict Fission Track ages and Track lengths distributions for some given thermal-his...
github_jupyter
``` import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.utils.data as Data import torchvision import numpy as np import pandas as pd import matplotlib.pyplot as plt path = 'data/mnist/' raw_train = pd.read_csv(path + 'train.csv') raw_test = pd.read_csv(pa...
github_jupyter
``` import sys sys.path.append('C:\\Users\dell-pc\Desktop\大四上\Computer_Vision\CNN') from data import * from network import three_layer_cnn # data train_data, test_data = loaddata() import numpy as np print(train_data.keys()) print("Number of train items: %d" % len(train_data['images'])) print("Number of test items: %d"...
github_jupyter
# Preliminary instruction To follow the code in this chapter, the `yfinance` package must be installed in your environment. If you do not have this installed yet, review Chapter 4 for instructions on how to do so. # Chapter 9: Risk is a Number ``` # Chapter 9: Risk is a Number import pandas as pd import numpy as np...
github_jupyter
# Boucles https://python.sdv.univ-paris-diderot.fr/05_boucles_comparaisons/ Répéter des actions ## Itération sur les éléments d'une liste ``` placard = ["farine", "oeufs", "lait", "sucre"] for ingredient in placard: print(ingredient) ``` Remarques : - La variable *ingredient* est appelée *variable d'itération...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import os print(os.listdir("../input")) import time # import pytorch import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import SGD,Adam,lr_scheduler from torch.utils.data im...
github_jupyter
``` from os import path # Third-party import astropy import astropy.coordinates as coord from astropy.table import Table, vstack from astropy.io import fits import astropy.units as u import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np %matplotlib inline from pyvo.dal import TAPService from pyi...
github_jupyter
``` import csv import matplotlib import matplotlib.pyplot as plt auth_csv_path = "./auth_endpoint_values.csv" service_csv_path = "./service_endpoint_values.csv" def convert_cpu_to_dict(file_path): data = [] with open(file_path) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') csv_re...
github_jupyter
<a href="https://bmi.readthedocs.io"><img src="https://raw.githubusercontent.com/csdms/espin/main/media/bmi-logo-header-text.png"></a> # Run the `Heat` model through its BMI `Heat` models the diffusion of temperature on a uniform rectangular plate with Dirichlet boundary conditions. This is the canonical example used...
github_jupyter
<a href="https://colab.research.google.com/github/iamsoroush/DeepEEGAbstractor/blob/master/cv_rnr_8s_proposed_gap.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title # Clone the repository and upgrade Keras {display-mode: "form"} !git clone...
github_jupyter
<a href="https://colab.research.google.com/github/Yoshibansal/ML-practical/blob/main/Cat_vs_Dog_Part-1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ##Cat vs Dog (Binary class classification) ImageDataGenerator (Understanding overfitting) Downlo...
github_jupyter
# Part I. ETL Pipeline for Pre-Processing the Files ## PLEASE RUN THE FOLLOWING CODE FOR PRE-PROCESSING THE FILES #### Import Python packages ``` # Import Python packages import pandas as pd import cassandra import re import os import glob import numpy as np import json import csv ``` #### Creating list of filepat...
github_jupyter
# MPLPPT `mplppt` is a simple library made from some hacky scripts I used to use to convert matplotlib figures to powerpoint figures. Which makes this a hacky library, I guess 😀. ## Goal `mplppt` seeks to implement an alternative `savefig` function for `matplotlib` figures. This `savefig` function saves a `matplotli...
github_jupyter
``` import sys import torch import torch.nn as nn import torch.nn.functional as F # Releasing the GPU memory torch.cuda.empty_cache() def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, ...
github_jupyter
<a href="https://colab.research.google.com/github/BachiLi/A-Tour-of-Computer-Animation/blob/main/A_Tour_of_Computer_Animation_Table_of_Contents.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> **A Tour of Computer Animation** -- [Tzu-Mao Li](https://...
github_jupyter
``` import urllib2 from bs4 import BeautifulSoup url = 'https://www.baidu.com/' content = urllib2.urlopen(url).read() soup = BeautifulSoup(content, 'html.parser') soup print(soup.prettify()) for tag in soup.find_all(True): print(tag.name) soup('head')# or soup.head soup.body soup.body.name soup.meta.string soup.f...
github_jupyter
# Approximate q-learning In this notebook you will teach a __tensorflow__ neural network to do Q-learning. __Frameworks__ - we'll accept this homework in any deep learning framework. This particular notebook was designed for tensorflow, but you will find it easy to adapt it to almost any python-based deep learning fr...
github_jupyter
# Developing Advanced User Interfaces *Using Jupyter Widgets, Pandas Dataframes and Matplotlib* While BPTK-Py offers a number of high-level functions to quickly plot equations (such as `bptk.plot_scenarios`) or create a dashboard (e.g. `bptk.dashboard`), you may sometimes be in a situation when you want to create more...
github_jupyter
<a href="https://colab.research.google.com/github/kartikgill/The-GAN-Book/blob/main/Skill-08/Cycle-GAN-No-Outputs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Import Useful Libraries ``` import pandas as pd import numpy as np import matplotlib...
github_jupyter
# 5. Algorithmic Question You consult for a personal trainer who has a back-to-back sequence of requests for appointments. A sequence of requests is of the form : 30, 40, 25, 50, 30, 20 where each number is the time that the person who makes the appointment wants to spend. You need to accept some requests, however yo...
github_jupyter
``` import pickle import pandas as pd import re import nltk from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer import numpy as np import bcolz import unicodedata import torch import torch.nn as nn import torch.nn.functional as F import time import torch.optim as optim import matplotlib.pyplot as ...
github_jupyter
<a href="https://colab.research.google.com/github/agemagician/Prot-Transformers/blob/master/Embedding/Advanced/Electra.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <h3> Extracting protein sequences' features using ProtElectra pretrained-model <h3...
github_jupyter
# Decision Point Price Momentum Oscillator (PMO) https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:dppmo ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import warnings warnings.filterwarnings("ignore") # fix_yahoo_finance is used to fetch data import fix_yahoo...
github_jupyter
``` import re import requests import time from requests_html import HTML from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument("--headless") driver = webdriver.Chrome(options=options) categories = [ "https://www.amazon.com/Best-Sellers-Toys-Ga...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline from sklearn.pipeline import Pipeline from sklearn.preprocessing import Imputer # 上述函数,其输入是包含1个多个枚举类别的2D数组,需要reshape成为这种数组 # from sklearn.preprocessing import CategoricalEncoder #后面会添加这个方法 from sklearn...
github_jupyter
``` library(keras) ``` **Loading MNIST dataset from the library datasets** ``` mnist <- dataset_mnist() x_train <- mnist$train$x y_train <- mnist$train$y x_test <- mnist$test$x y_test <- mnist$test$y ``` **Data Preprocessing** ``` # reshape x_train <- array_reshape(x_train, c(nrow(x_train), 784)) x_test <- array_re...
github_jupyter
## This notebook contains a sample code for the COMPAS data experiment in Section 5.2. Before running the code, please check README.md and install LEMON. ``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from sklearn import feature_extraction from sklearn import preprocessing from sklear...
github_jupyter
``` import pandas as pd import numpy as np import re from scipy.integrate import odeint # Read the data in, then select the relevant columns, and adjust the week so it is easier to realize # as a time series. virii = ["A (H1)", "A (H3)", "A (2009 H1N1)", "A (Subtyping not Performed)", "B"] virus = "B" file = "data/200...
github_jupyter
# Scene Classification-Test ## 1. Preprocess-KerasFolderClasses - Import pkg - Extract zip file - Preview "scene_classes.csv" - Preview "scene_{0}_annotations_20170922.json" - Test the image and pickle function - Split data into serval pickle file This part need jupyter notebook start with "jupyter notebook --Notebook...
github_jupyter
``` from collections import OrderedDict import arviz as az import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc as pm import scipy as sp from theano import shared %config InlineBackend.figure_format = 'retina' az.style.use('arviz-darkgrid') ``` #### Code 11.1 ``` trolley_df = pd.read_c...
github_jupyter
<a href="https://colab.research.google.com/github/iesous-kurios/DS-Unit-2-Applied-Modeling/blob/master/module4/BuildWeekProject.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` %%capture import sys # If you're on Colab: if 'google.colab' in sys....
github_jupyter
# Chapter 3 ***Ver como criar uma tabela de conteúdo TOC** ## Strings ``` a = "My dog's name is" b = "Bingo" c = a + " " + b c #trying to add string and integer d = "927" e = 927 d + e ``` ## Lists ``` a = [0, 1, 1, 2, 3, 5, 8, 13] b = [5., "girl", 2+0j, "horse", 21] b[0] b[1] ``` <div class="alert alert-block al...
github_jupyter
``` %matplotlib inline ``` Captum을 사용하여 모델 해석하기 =================================== **번역**: `정재민 <https://github.com/jjeamin>`_ Captum을 사용하면 데이터 특징(features)이 모델의 예측 또는 뉴런 활성화에 미치는 영향을 이해하고, 모델의 동작 방식을 알 수 있습니다. 그리고 \ ``Integrated Gradients``\ 와 \ ``Guided GradCam``\ 과 같은 최첨단의 feature attribution 알고리즘을 적용할 수 있습니다....
github_jupyter
``` import sys sys.path.append('../src') from numpy import * import matplotlib.pyplot as plt from Like import * from PlotFuncs import * import WIMPFuncs pek = line_background(6,'k') fig,ax = MakeLimitPlot_SDn() alph = 0.25 cols = cm.bone(linspace(0.3,0.7,4)) nucs = ['Xe','Ge','NaI'] zos = [0,-50,-100,-50] C_Si = WIM...
github_jupyter
# <center>HW 01: Geomviz: Visualizing Differential Geometry<center> ## <center>Special Euclidean Group SE(n)<center> <center>$\color{#003660}{\text{Swetha Pillai, Ryan Guajardo}}$<center> # <center> 1.) Mathematical Definition of Special Euclidean SE(n)<center> ### <center> This group is defined as the set of direct...
github_jupyter
## A track example The file `times.dat` has made up data for 100-m races between Florence Griffith-Joyner and Shelly-Ann Fraser-Pryce. We want to understand how often Shelly-Ann beats Flo-Jo. ``` %pylab inline --no-import-all ``` <!-- Secret comment: How the data were generated w = np.random.normal(0,.07,10000) x ...
github_jupyter
## Load Python Packages ``` # --- load packages import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.nn.modules.distance import PairwiseDistance from torch.utils.data import Dataset from torchvision import transforms from torchsummary import summary from torch....
github_jupyter
# Data Data en handelingen op data ## Informatica een taal leren $\sim$ **syntax** (noodzakelijk, maar niet het punt) ... informatica studeren $\sim$ **semantiek** (leren hoe machines denken!) Een programmeertaal als Python leren heeft alles te maken met syntax waarmee je handelingen kan schrijven die een machine ...
github_jupyter