text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Movie Recommender System ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import ast %matplotlib inline movies = pd.read_csv('tmdb_5000_movies.csv') credits = pd.read_csv('tmdb_5000_credits.csv') movies.head() credits.head() movies = movies.merge(credits, on='title') m...
github_jupyter
``` !pip install transformers # generics import pandas as pd import numpy as np from tqdm import tqdm import re from collections import defaultdict import matplotlib.pyplot as plt import random !pip install pytypo import pytypo from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import tra...
github_jupyter
# Quantization of Image Classification Models This tutorial demostrates how to apply INT8 quantization to Image Classification model using [Post-training Optimization Tool API](../../compression/api/README.md). The Mobilenet V2 model trained on Cifar10 dataset is used as an example. The code of this tutorial is design...
github_jupyter
# Using PLIO to analyze control networks PLIO is a general purpose library for reading data from various sources. In this workshop, we will be using PLIO's ability to read ISIS control networks into a Pandas dataframe. ``` # PLIO uses pysis for some other things. We don't technically need this but it avoids a warning....
github_jupyter
``` %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import datetime import pytz columns = ['Capture_time', 'Id'] data = pd.read_csv('evo_data_menor.csv', usecols=columns, nrows=500000) data.head() print(datetime.datetime.now()) # Colleting vehicle ids car_ids = list(data.Id.unique()) print(date...
github_jupyter
# Activation Functions This function introduces activation functions in TensorFlow We start by loading the necessary libraries for this script. ``` import matplotlib.pyplot as plt import numpy as np import tensorflow as tf # from tensorflow.python.framework import ops # ops.reset_default_graph() tf.reset_default_gra...
github_jupyter
<!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> *This notebook contains an excerpt from the [Python Data Science Handbook](http://shop.oreilly.com/product/0636920034919.do) by Jake VanderPlas; the content is available [on GitHub](https://github.com/jakevdp/Pyth...
github_jupyter
# PyWRspice Wrapper Tutorial: Run simulation on remote SSH server #### Prerequisite: * You need to complete the *Tutorial.ipynb* notebook first. Here we assume you are already famililar with running PyWRspice on a local computer. ``` # Add pyWRspice location to system path, if you haven't run setup.py import sys sys...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/NAIP/ndwi_single.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href="https...
github_jupyter
# The Fuzzing Book ## Sitemap While the chapters of this book can be read one after the other, there are many possible paths through the book. In this graph, an arrow _A_ → _B_ means that chapter _A_ is a prerequisite for chapter _B_. You can pick arbitrary paths in this graph to get to the topics that interest you mo...
github_jupyter
``` import h5py import numpy as np import matplotlib.pyplot as plt plt.style.use('presentation') from shabanipy.jj.plotting_general import plot_inplane_vs_bias, plot_inplane_vs_Ic_Rn, plot_inplane_vs_IcRn #: Name of the sample that must appear in the measurement name usually of the form "{Wafer}-{Piece}_{Design}-{It...
github_jupyter
# WOR Forecasting In this section is introduced the basic classes and functions to make Forecast by applying the Wor Methodology ``` import os from dcapy import dca from datetime import date import numpy as np ``` The WOR forecasting is an empirical method to estimate the trend of the water production with respect t...
github_jupyter
``` import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 from numpy import array origin_image=mpimg.imread("canny-edge-detection-test.jpg") plt.figure() # plt.subplot(1,3,1) # plt.imshow(image) image=array(origin_image) ysize = image.shape[0] xsize = image.shape[1] left_bott...
github_jupyter
# Bayesian Regression Using NumPyro In this tutorial, we will explore how to do bayesian regression in NumPyro, using a simple example adapted from Statistical Rethinking [[1](#References)]. In particular, we would like to explore the following: - Write a simple model using the `sample` NumPyro primitive. - Run inf...
github_jupyter
# Customizing datasets in fastai ``` from fastai import * from fastai.gen_doc.nbdoc import * from fastai.vision import * ``` In this tutorial, we'll see how to create custom subclasses of [`ItemBase`](/core.html#ItemBase) or [`ItemList`](/data_block.html#ItemList) while retaining everything the fastai library has to ...
github_jupyter
# Creating a Real-Time Inferencing Service You've spent a lot of time in this course training and registering machine learning models. Now it's time to deploy a model as a real-time service that clients can use to get predictions from new data. ## Connect to Your Workspace The first thing you need to do is to connec...
github_jupyter
<a href="https://colab.research.google.com/github/bhuiyanmobasshir94/Cow-weight-and-Breed-Prediction/blob/main/notebooks/031_dec.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import numpy as np import pandas as pd import sys import os import P...
github_jupyter
## 7. Fourier-transzformációs módszer, FFTMethod A kiértékelés a lépései: **betöltés &rarr; előfeldolgozás &rarr; IFFT &rarr; ablakolás &rarr; FFT &rarr; fázis** A programban is hasonló nevű a függvényeket kell meghívni. Az ajánlott sorrend a függvények hívásában a fenti folyamatábra, mivel nem garantált, hogy a ten...
github_jupyter
``` # our usual things! %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import numpy as np # weather in Champaign! w = pd.read_csv("/Users/jillnaiman1/Downloads/2018_ChampaignWeather.csv") w # sort by date w.sort_values(by='DATE') # w is our pandas dataframe, sort_values is a pandas call type(w['...
github_jupyter
# GeoNet FDSN webservice with Obspy demo - Station Service This demo introduces some simple code that requests data using [GeoNet's FDSN webservices](http://www.geonet.org.nz/data/tools/FDSN) and the [obspy module](https://github.com/obspy/obspy/wiki) in python. This notebook uses Python 3. ### Getting Started - Imp...
github_jupyter
``` from keras import applications from keras.models import Sequential, Model from keras.models import Model from keras.layers import Dropout, Flatten, Dense, Activation, Reshape from keras.callbacks import CSVLogger import tensorflow as tf from scipy.ndimage import imread import numpy as np import random from keras.la...
github_jupyter
Thanks for @christofhenkel @abhishek @iezepov for their great work: https://www.kaggle.com/christofhenkel/how-to-preprocessing-for-glove-part2-usage https://www.kaggle.com/abhishek/pytorch-bert-inference https://www.kaggle.com/iezepov/starter-gensim-word-embeddings ``` import sys package_dir = "../input/ppbert/pytorc...
github_jupyter
# python-sonic - Programming Music with Python, Sonic Pi or Supercollider Python-Sonic is a simple Python interface for Sonic Pi, which is a real great music software created by Sam Aaron (http://sonic-pi.net). At the moment Python-Sonic works with Sonic Pi. It is planned, that it will work with Supercollider, too. ...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/image_displacement.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" hre...
github_jupyter
[Loss Function](https://www.bualabs.com/archives/2673/what-is-loss-function-cost-function-error-function-loss-function-how-cost-function-work-machine-learning-ep-1/) หรือ Cost Function คือ การคำนวน Error ว่า yhat ที่โมเดลทำนายออกมา ต่างจาก y ของจริง อยู่เท่าไร แล้วหาค่าเฉลี่ย เพื่อที่จะนำมาหา Gradient ของ Loss ขึ้นกับ ...
github_jupyter
# Example: CanvasXpress circular Chart No. 6 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/circular-6.html This example is generated using the reproducible JSON obtained from the above pag...
github_jupyter
# Exploring different Coastline options in Magics This notebook will help you discover lots of posibilities for designing background of your maps in Magics. From your workstation: load magics module swap(or load) Magics/new jupyter notebook load this notebook **mcoast** controls background of our maps. He...
github_jupyter
# Streaming Sample: Cosmos DB ChangeFeed - Databricks In this notebook, you read a live stream of tweets that stored in Cosmos DB by leveraging Apache Spart to read the Cosmos DB's Change Feed, and run transformations on the data in Databricks cluster. ## prerequisites: - Databricks Cluster (Spark) - Cosmos DB Spark C...
github_jupyter
# Deep Neural Network You see a lot of people around you who are interested in deep neural networks and you think that it might be interesting to start thinking about creating a software that is as flexible as possible and allows novice users to test this kind of methods. You have no previous knowledge and while sear...
github_jupyter
``` from __future__ import print_function, division import json import numpy as np import pandas as pd import librosa import soundfile as sf import torch from torch.utils.data import Dataset from keras.preprocessing.sequence import pad_sequences # Ignore warnings import warnings warnings.filterwarnings("ignore") cl...
github_jupyter
# CatBoostRegressor with RobustScaler This Code template is for regression analysis using CatBoostRegressor and Robust Scaler Feature Scaling technique. CatBoost is an algorithm for gradient boosting on decision trees. <img src="https://cdn.blobcity.com/assets/gpu_recommended.png" height="25" style="margin-bottom:-1...
github_jupyter
##### Copyright 2018 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
``` from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf from tensorflow import keras from os import listdir, path import numpy as np from collections import defaultdict import datetime import random random.seed(42) # Keep the order stable everytime shuffling the f...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Introduction" data-toc-modified-id="Introduction-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Introduction</a></span><ul class="toc-item"><li><span><a href="#Example-01:-Extract-text" data-toc-modified...
github_jupyter
# **Neural machine translation with attention** Today we will train a sequence to sequence (seq2seq) model for Spanish to English translation. This is an advanced example that assumes some knowledge of sequence to sequence models. After training the model in this notebook, you will be able to input a Spanish sentence...
github_jupyter
# Predict google map review dataset ## model - kcbert - fine-tuned with naver shopping review dataset (200,000개) - train 5 epochs - 0.97 accuracy ## dataset - google map review of tourist places in Daejeon, Korea ``` import torch from torch import nn, Tensor from torch.optim import Optimizer from torch.utils.data im...
github_jupyter
### Testing for Interactive use case ``` import mlflow from azureml.core import Workspace, Experiment, Environment, Datastore, Dataset, ScriptRunConfig from azureml.core.runconfig import PyTorchConfiguration # from azureml.widgets import RunDetails from azureml.core.compute import ComputeTarget, AmlCompute from azurem...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/2_transfer_learning_roadmap/5_exploring_model_families/2_vgg/1.1)%20Intro%20to%20vgg%20network%20-%20mxnet%20backend.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Op...
github_jupyter
# Use PMML to predict iris species with `ibm-watson-machine-learning` This notebook contains steps from storing sample PMML model to starting scoring new data. Some familiarity with python is helpful. This notebook uses Python 3. You will use a **Iris** data set, which details measurements of iris perianth. Use the...
github_jupyter
# Metadata preprocessing tutorial Melusine **prepare_data.metadata_engineering subpackage** provides classes to preprocess the metadata : - **MetaExtension :** a transformer which creates an 'extension' feature extracted from regex in metadata. It extracts the extensions of mail adresses. - **MetaDate :** a transforme...
github_jupyter
<p><img alt="DataOwl" width=150 src="http://gwsolutions.cl/Images/dataowl.png", align="left", hspace=0, vspace=5></p> <h1 align="center">Aplicación de la derivada</h1> <h4 align="center">Ecuaciones de una variable y Optimización</h4> <pre><div align="center"> La idea de este notebook es que sirva para iniciarse en co...
github_jupyter
# Results summary | Logistic Regression | LightGBM Classifier | Logistic Regression + ATgfe | |-------------------------------------------------------------------------|--------...
github_jupyter
``` import h2o h2o.init(max_mem_size = 2) #uses all cores by default h2o.remove_all() %matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd from h2o.estimators.deeplearning import H2ODeepLearningEstimator higgs = h2o.import_file('higgs_boston_train.csv') higgs.head() higgs...
github_jupyter
# Objective * 20181225: * Predict stock price in next day using XGBoost * Given prices and other features for the last N days, we do prediction for day N+1 * Here we split 3 years of data into train(60%), dev(20%) and test(20%) * 20190110 - Diff from StockPricePrediction_v1_xgboost.ipynb: * Here we sca...
github_jupyter
## In this notebook: - Using a pre-trained convnet to do feature extraction - Use ConvBase only for feature extraction, and use a separate machine learning classifier - Adding ```Dense``` layers to top of a frozen ConvBase, allowing us to leverage data augmentation - Fine-tuning a pre-trained convnet (Skipped,...
github_jupyter
# Gradient Descent Optimizations Mini-batch and stochastic gradient descent is widely used in deep learning, where the large number of parameters and limited memory make the use of more sophisticated optimization methods impractical. Many methods have been proposed to accelerate gradient descent in this context, and ...
github_jupyter
# The Stick and Ball Geometry The ``SpheresAndCylinders`` class contains an assortment of pore-scale models that generate geometrical information assuming the pores are spherical and throats are cylindrical. The ``SpheresAndCylinders`` is a perfect starting point for generating your own custom geometry. In fact, it...
github_jupyter
# Welcome to Exkaldi In this section, we will train a n-grams language model and query it. Althrough __Srilm__ is avaliable in exkaldi, we recommend __Kenlm__ toolkit. ``` import exkaldi import os dataDir = "librispeech_dummy" ``` Firstly, prepare the lexicons. We have generated and saved a __LexiconBank__ object ...
github_jupyter
<h1 style="text-align:center">Chapter 2</h1> --- ###### Words --- Take a look at this sentence : 'The quick brown fox jumps over the lazy fox, and took his meal.' * The sentence has 13 _Words_ if you don't count punctuations, and 15 if you count punctions. * To count punctuation as a word or not depends on th...
github_jupyter
``` import torch import torch.nn.functional as F import torchsde from torchvision import datasets, transforms import math import numpy as np import pandas as pd from tqdm import tqdm from torchvision.transforms import ToTensor from torch.utils.data import DataLoader import functorch import matplotlib.pyplot as plt ...
github_jupyter
# Assignment 2 - Q-Learning and Expected Sarsa Welcome to Course 2 Programming Assignment 2. In this notebook, you will: - Implement Q-Learning with $\epsilon$-greedy action selection - Implement Expected Sarsa with $\epsilon$-greedy action selection - Investigate how these two algorithms behave on Cliff World (descr...
github_jupyter
# 2. Imperative Programming Languages 우선 2.5까지 나오는 내용 중에서 빼고 살펴보는데, 지난번에 `CMa01.ipynb`에 작성했던 컴파일러 코드에서 문제점을 수정해 보자. --- 컴파일 타겟이 되는 VM의 단순화된 버전을 하스켈로 구현 ``` -- {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE Flex...
github_jupyter
## Hi, i was having a hard time trying to load this huge data set as a pandas data frame on my pc, so i searched for alternative ways of doing this as i don't want to pay for cloud services and don't have access to better machines. ### actually the solution was pretty simple, so i'm sharing what i ended up with, maybe ...
github_jupyter
# Randomized Benchmarking ## Contents 1. [Introduction](#intro) 2. [The Randomized Benchmarking Protocol](#protocol) 3. [The Intuition Behind RB](#intuition) 4. [Simultaneous Randomized Benchmarking](#simultaneousrb) 5. [Predicted Gate Fidelity](#predicted-gate-fidelity) 6. [References](#refe...
github_jupyter
``` # default_exp datasets #export from fastai.text import * from tse.preprocessing import * from tse.tokenizers import * ``` ### Prepare Data Inputs for Q/A Following for each input for training is needed: `input_ids`, `attention_mask`, `token_type_ids`, `offsets`, `answer_text`, `start_tok_idx`, `end_tok_idx` Pr...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Automated Machine Learning _**Prepare Data using `azureml.dataprep` for Local Execution**_ ## Contents 1. [Introduction](#Introduction) 1. [Setup](#Setup) 1. [Data](#Data) 1. [Train](#Train) 1. [Results](#Results) 1. [Test](#...
github_jupyter
# Introduction to AlTar/Pyre applications ### 1. Introduction An AlTar application is based on the [pyre](https://github.com/pyre/pyre) framework. Compared with traditional Python programming, the `pyre` framework provides enhanced features for developing high performance scientific applications, including - It int...
github_jupyter
# Hacking Into FasterRcnn in Pytorch - toc: true - badges: true - comments: true - categories: [jupyter] - image: images/chart-preview.png # Brief Intro In the post I will show how to tweak some of the internals of FaterRcnn in Pytorch. I am assuming the reader is someone who already have trained an object detection...
github_jupyter
<!-- dom:TITLE: PHY321: Harmonic Oscillations, Damping, Resonances and time-dependent Forces --> # PHY321: Harmonic Oscillations, Damping, Resonances and time-dependent Forces <!-- dom:AUTHOR: [Morten Hjorth-Jensen](http://mhjgit.github.io/info/doc/web/) at Department of Physics and Astronomy and Facility for Rare Ion ...
github_jupyter
# Data Processing The project has five steps: - delet irregular (too large or small (no data)) and non-image data - remove duplicate image - remove irrelevant image - split dataset: create classes.txt, train.txt, test.txt - rename images ### Deleting irragular images ``` import os import sys import imghdr class Ima...
github_jupyter
``` import pymc3 as pm import matplotlib.pyplot as plt import pandas as pd import numpy as np import theano.tensor as tt import theano %load_ext autoreload %autoreload 2 %matplotlib inline %config InlineBackend.figure_format = 'retina' df = pd.read_csv('../datasets/bikes/hour.csv') df feature_cols = ['workingday', 'h...
github_jupyter
Parametric non Parametric inference =================== Suppose you have a physical model of an output variable, which takes the form of a parametric model. You now want to model the random effects of the data by a non-parametric (better: infinite parametric) model, such as a Gaussian Process as described in [Bayesian...
github_jupyter
# CST PTM Data Overview The PTM data from CST has a significant amount of missing data and requires special consideration when normalizing. The starting data is ratio-level-data - where log2 ratios have been calculated from the cancerous cell lines compared to the non-cancerous 'Normal Pool' data from within the 'plex...
github_jupyter
# Sublime Text ## Getting set up ### Laptop install Sublime Text (Done once per laptop) 1. Step one is to download and install [Sublime Text](https://www.sublimetext.com/3). Sidenote: You don't need to purchase a license, you can use it forever with all features in evaluate mode. If you purchase a license it follows...
github_jupyter
<a href="https://colab.research.google.com/github/leehanchung/cs224w/blob/main/notebooks/XCS224W_Colab3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **CS224W - Colab 3** In Colab 2 we constructed GNN models by using PyTorch Geometric's built i...
github_jupyter
``` !python3 -m pip freeze | grep xlrd !python3 -m pip freeze | grep openpy ``` # Использование библиотеки pandas для анализа описаний уязвимостей из банка данных ФСТЭК В статье демонстрируются возможности использования библиотеки pandas для работы с информацией из банка данных ФСТЭК (bdu.fstec.ru) об угрозах (thrlis...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # LightGBM: A Highly Efficient Gradient Boosting Decision Tree This notebook will give you an example of how to train a LightGBM model to estimate click-through rates on an e-commerce advertisement. We will train a...
github_jupyter
### Dataset Lets Load the dataset. We shall use the following datasets: Features are in: "sido0_train.mat" Labels are in: "sido0_train.targets" ``` from scipy.io import loadmat import numpy as np X = loadmat(r"/Users/rkiyer/Desktop/teaching/CS6301/jupyter/data/sido0_matlab/sido0_train.mat") y = np.loadtxt(r"/Users/rk...
github_jupyter
# Singleton Networks ``` import qualreas as qr import os import copy qr_path = os.path.join(os.getenv('PYPROJ'), 'qualreas') alg_dir = os.path.join(qr_path, "Algebras") ``` ## Make a Test Network ``` test1_net_dict = { 'name': 'Network Copy Test #1', 'algebra': 'Extended_Linear_Interval_Algebra', 'descri...
github_jupyter
``` import pandas import numpy as np import sklearn from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import RandomForestRegressor from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split import glob ``` # San Francisco State University ## Software ...
github_jupyter
# Estadísticos principales - Esperanzas, varianza y ley débil de los grandes números - Variables aleatorias especiales ## Esperanza La esperanza o valor esperado de una v.a. $X$ se denota $E[X]$ y se calcula como: $\begin{array}{ll} E[X] = \left\{\begin{array}{ll} \sum_i x_i P(X=x_i) & si\,X\, discreta\\ ...
github_jupyter
# Linear Algebra with Python and NumPy ``` # First, we need to import the package NumPy, which is the library enabling all the fun with algebraic structures. from numpy import * ``` ## Complex Numbers A complex number is a number of the form $z = x + jy$, where $x$ and $y$ are real numbers and $j$ is the **_imaginar...
github_jupyter
# Two Market Makers - via Pontryagin This notebook corresponds to section 4 (**Agent based models**) of "Market Based Mechanisms for Incentivising Exchange Liquidity Provision" available [here](https://vega.xyz/papers/liquidity.pdf). It models two market makers and solves the resulting game by an iterative scheme base...
github_jupyter
``` import sys import os sys.path.insert(0, os.path.abspath('../src/')) ``` # Plotting ``` from pathlib import Path import SimplePreprocessor as sp DATASETPATH = Path("../dataset/") pr = sp.SimplePreprocessor(deltas=True, discretize=False, flevel="MAGIK") netdata = pr.load_path(DATASETPATH) netdata["_date"] = netda...
github_jupyter
<a href="https://colab.research.google.com/github/cedeerwe/brutalna-akademia/blob/master/notebooks/zaverecny_test.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Inštrukcie Test pozostáva zo 7 príkladov, dokopy za 50 bodov. Na test máš 3 hodiny č...
github_jupyter
# Data types & Structures ### A great advatage of `Python` is the type of data it can handle & combine Python has been widely used to handle internet related operations, which means lots and lots of text and numbers. combined! *** ## Let's start with the basic types! ### Like other programing languages, `Python` dat...
github_jupyter
# Masakhane - Machine Translation for African Languages (Using JoeyNMT) ## Note before beginning: ### - The idea is that you should be able to make minimal changes to this in order to get SOME result for your own translation corpus. ### - The tl;dr: Go to the **"TODO"** comments which will tell you what to update to...
github_jupyter
# Evaluate the Performance of MPNN models Get all of the models, regardless how we trained them and evaluate their performance ``` %matplotlib inline from matplotlib import pyplot as plt from datetime import datetime from sklearn import metrics from tqdm import tqdm from glob import glob import pandas as pd import num...
github_jupyter
# Multi-center analysis ### Imports ``` import sys sys.path.append('../') from PAINTeR import connectivity # in-house lib used for the RPN-signature from PAINTeR import plot # in-house lib used for the RPN-signature from PAINTeR import model # in-house lib used for the RPN-signature import num...
github_jupyter
(tune-mnist-keras)= # Using Keras & TensorFlow with Tune ```{image} /images/tf_keras_logo.jpeg :align: center :alt: Keras & TensorFlow Logo :height: 120px :target: https://www.keras.io ``` ```{contents} :backlinks: none :local: true ``` ## Example ``` import argparse import os from filelock import FileLock from t...
github_jupyter
An example showing how different online solvers perform on the hand-written digits dataset. #### New to Plotly? Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/). <br>You ca...
github_jupyter
``` # Useful for debugging %load_ext autoreload %autoreload 2 # Nicer plotting import matplotlib import matplotlib.pyplot as plt %matplotlib inline %config InlineBackend.figure_format = 'retina' matplotlib.rcParams['figure.figsize'] = (8,4) ``` # Disgten example Similar to the simple example, but generating particles...
github_jupyter
``` #https://pytorch.org/tutorials/beginner/pytorch_with_examples.html ``` # MNIST Dataset ### http://yann.lecun.com/exdb/mnist/ ### The MNIST database of handwritten digits, available from this page, has a training set of 60,000 examples, and a test set of 10,000 examples. It is a subset of a larger set available fro...
github_jupyter
# List, Set, and Dictionary Comprehensions In our prior session we discussed a variety of loop patterns. One of the most common patterns that we encounter in practice is the need to iterate through a list of values, transform the elements of the list using some operations, filter out the results, and return back a n...
github_jupyter
# *Circuitos Elétricos I - Semana 10* ### Problema 1 (Problema 7.19 - Nilsson) Para o circuito abaixo, pede-se: <img src="./figures/J13C1.png" width="400"> a) Determine a tensão $v_0(t)$ sobre o indutor de $48\;mH$ para $t\geq0$.\ b) Determine a corrente $i_0(t)$ sobre o indutor de $48\;mH$ para $t\geq0$.\ c) Det...
github_jupyter
``` from __future__ import absolute_import, division, print_function, unicode_literals from IPython import display from matplotlib import pyplot as plt from scipy.ndimage.filters import gaussian_filter1d import pandas as pd import numpy as np import datetime import tensorflow as tf !rm -rf ./logs/ # Load the Tens...
github_jupyter
<h1 align=center>The Cobweb Model</h1> Presentation follows <a href="http://www.parisschoolofeconomics.eu/docs/guesnerie-roger/hommes94.pdf">Hommes, <em>JEBO 1994</em></a>. Let $p_t$ denote the <em>observed price</em> of goods and $p_t^e$ the <em>expected price</em> of goods in period $t$. Similarly, let $q_t^d$ deno...
github_jupyter
# Band Ratios Conflations This notebook steps through how band ratio measures are underdetermined. By 'underdetermined', we mean that the same value, or same change in value between measures, can arise from different underlying causes. This shows that band ratios are a non-specific measure. As an example case, w...
github_jupyter
# Python Data Analysis ## Introduction In this lab, we'll make use of everything we've learned about pandas, data cleaning, and simple data analysis. In order to complete this lab, you'll have to import, clean, combine, reshape, and visualize data to answer questions provided, as well as your own questions! ## Object...
github_jupyter
Derived from https://arxiv.org/pdf/1711.07128.pdf ``` import warnings warnings.filterwarnings("ignore") import sys import os import tensorflow as tf # sys.path.append("../libs") sys.path.insert(1, '../') from libs import input_data from libs import models from libs import trainer from libs import freeze flags=tf.ap...
github_jupyter
# "E is for Exploratory Data Analysis: Categorical Data" > What is Exploratory Data Analysis (EDA), why is it done, and how do we do it in Python? - toc: false - badges: True - comments: true - categories: [E] - hide: False - image: images/e-is-for-eda-text/alphabet-close-up-communication-conceptual-278887.jpg ## _W...
github_jupyter
``` from IPython.display import Image import torch import torch.nn as nn import torch.nn.functional as F import math, random from scipy.optimize import linear_sum_assignment from utils import NestedTensor, nested_tensor_from_tensor_list, MLP Image(filename="figs/model.png", retina=True) ``` This notebook provides...
github_jupyter
## Baltic test case configuration Diagnostics output to close heat, salt, thickness budgets, and derive watermass transformation. This notebook is a working space to explore that output. ``` import xarray as xr import numpy as np from xhistogram.xarray import histogram ### Data loading, grabbed from MOM6-analysis co...
github_jupyter
``` from pathlib import Path import numpy as np import pandas as pd import swifter import cleantext pd.options.display.max_colwidth = 1000 OUT = Path('~/data/ynacc_proc/replicate/threads_last') BASE_PATH = Path('/mnt/data/datasets/ydata-ynacc-v1_0') ANN1 = BASE_PATH/'ydata-ynacc-v1_0_expert_annotations.tsv' ANN2 = ...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import gc import json import math import cv2 import PIL from PIL import Image import seaborn as sns sns.set(style='darkgrid') from sklearn.preprocessing import LabelEncoder from keras.utils import to_categoric...
github_jupyter
# Intro to reimbursements: overview with visualization This notebook provides an overview of the `2017-03-15-reimbursements.xz` dataset, which contains broad data regarding CEAP usage in all terms since 2009. It aims to provide an example of basic analyses and visualization by exploring topics such as: - Average mo...
github_jupyter
**Copyright 2021 The TensorFlow Hub Authors.** Licensed under the Apache License, Version 2.0 (the "License"); ``` # Copyright 2021 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from PIL import Image def _if_near(point, mask, nearest_neighbor): nn = nearest_neighbor w,h = mask.shape x,y = point mask = np.pad(mask,nn,'edge') x += nn y += nn if(w+nn>x and h+nn>y): x_i,y_i = int(x+0.5),int(y+0.5) #r...
github_jupyter
### Problem 1 __We will use a full day worth of tweets as an input (there are total of 4.4M tweets in this file, but you only need to read 1M):__ http://rasinsrv07.cstcis.cti.depaul.edu/CSC455/OneDayOfTweets.txt __a. Create a 3rd table incorporating the Geo table (in addition to tweet and user tables that you already...
github_jupyter
# Tutorial of Node Schematas - PI & TwoSymbol Visualization of schematas for simple boolean nodes (automatas) ``` %load_ext autoreload %autoreload 2 %matplotlib inline from __future__ import division import numpy as np import pandas as pd from IPython.display import Image, display import cana from cana.datasets.bools ...
github_jupyter