text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` # default_exp infousa ``` # Info-USA Intake and Operations > This notebook uses Info-USA data to generate a portion of BNIA's Vital Signs report. Todo: - Wrap as Function #### __Indicators Used__ - 131 artbusXX Arts and Culture - 132 artempXX Arts and Culture - 143 numbusXX Workforce and Economic Development...
github_jupyter
# Catch that asteroid! ``` import matplotlib.pyplot as plt plt.ion() from astropy import units as u from astropy.time import Time from astropy.utils.data import conf conf.dataurl conf.remote_timeout ``` First, we need to increase the timeout time to allow the download of data occur properly ``` conf.remote_timeout ...
github_jupyter
This notebook presents how to train ARedsum models, the extractive summarization based models, on ThaiSum dataset. # Introduction to ARedSumSentRank Cite from their paper's abstract ["AREDSUM: Adaptive Redundancy-Aware Iterative Sentence Ranking for Extractive Document Summarization"](https://arxiv.org/abs/2004.06176)...
github_jupyter
# Bayesian Models We are now going to dig further into a specific type of **Probabilistic Graphical Model**, specifically **Bayesian Networks**. We will discuss the following: 1. What are Bayesian Models 2. Independencies in Bayesian Networks 3. How is Bayesian Model encoding the Joint Distribution 4. How we do inferen...
github_jupyter
# Что такое AXON [AXON](http://intellimath.bitbucket.org/axon) это нотация для сериализованного представления объектов, документов и данных в текстовой форме. Она объединяет в себе *простоту* [JSON](http://www.json.org), *расширяемость* [XML](http://www.w3.org/xml) и *удобочитаемость* [YAML](http://www.yaml.org). Ес...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
# Waveform and spectrogram display Select an audio file from the dropdown list to display its waveform and spectrogram. ``` import os import parselmouth import numpy as np from phonlab.utils import dir2df from bokeh_phon.utils import remote_jupyter_proxy_url_callback, default_jupyter_url from bokeh_phon.models.audio...
github_jupyter
# Grouping your data ``` import warnings warnings.simplefilter('ignore', FutureWarning) import matplotlib matplotlib.rcParams['axes.grid'] = True # show gridlines by default %matplotlib inline import pandas as pd ``` In last week modules, you saw how to merge two datasets containing a common column to create a sing...
github_jupyter
``` from alpaca import Telescope, Camera, FilterWheel import ciboulette.base.ciboulette as Cbl import ciboulette.sector.sector as Sct import ciboulette.utils.ephemcc as Eph import ciboulette.utils.exposure as Exp import ciboulette.utils.planning as Pln ``` #### Initialization of objects ``` cbl = Cbl.Ciboulette() eph...
github_jupyter
``` %load_ext rpy2.ipython %matplotlib inline from fbprophet import Prophet import pandas as pd import logging logging.getLogger('fbprophet').setLevel(logging.ERROR) import warnings warnings.filterwarnings("ignore") %%R library(prophet) ``` ### Forecasting Growth By default, Prophet uses a linear model for its foreca...
github_jupyter
``` import os import lmdb import caffe import numpy as np import matplotlib.pyplot as plt %matplotlib inline from snntoolbox.io_utils.common import to_categorical path_to_dataset = '/home/rbodo/.snntoolbox/Datasets/roshambo' lmdb_env = lmdb.open(path_to_dataset) lmdb_txn = lmdb_env.begin() lmdb_cursor = lmdb_txn.curs...
github_jupyter
``` import json import pandas as pd import numpy as np import qgrid from _vars import * import os import sys import zipfile zip_filepath="json_archive.zip" #input parameter target_dir="extracted_files/" #input parameter files_to_extract = ['40171448_final.json', '10171448_final.json', '14171448_final.json'] #WRITE HE...
github_jupyter
``` import os import sys module_path = os.path.abspath(os.path.join('../../')) print(module_path) if module_path not in sys.path: sys.path.append(module_path) from pydub import AudioSegment import soundfile as sf from params import EXCERPT_LENGTH,INPUT_DIR_PARENT,OUTPUT_DIR # sys.path.insert(0, './models/audioset'...
github_jupyter
# Assess and Monitor QCs, Internal Standards, and Common Metabolites ## This notebook will guide people to * ## Identify their files * ## Specify the LC/MS method used * ## Specify the text-string used to differentiate blanks, QCs, and experimental injections * ## Populate the run log with the pass/fail outcome for ea...
github_jupyter
## Pipeline sequência de execução ## <font color='blue'>Streming de dados no twitter com MongoDB, Pandas e Scikit Learn</font> ## Preparação de conexão com twitter ``` # instalação de pacotes tweepy !pip install tweepy # importando os módulos tweepy, Datetime e Json # listerner, ouvinte, vai ficar ouvindo pelos twit...
github_jupyter
``` # Useful for debugging %load_ext autoreload %autoreload 2 # Nicer plotting import matplotlib %matplotlib inline %config InlineBackend.figure_format = 'retina' matplotlib.rcParams['figure.figsize'] = (8,4) ``` # Movie example using write_beam Here we insert write_beam elements into an existing lattice, run, save t...
github_jupyter
``` activations = [nn.ELU(),nn.LeakyReLU(),nn.PReLU(),nn.ReLU(),nn.ReLU6(),nn.RReLU(),nn.SELU(),nn.CELU(),nn.GELU(),nn.SiLU(),nn.Tanh()] for activation in activations: wandb.init(project=PROJECT_NAME,name=f'activation-{activation}') model = Test_Model(conv1_output=32,conv2_output=8,conv3_output=64,fc1_output=51...
github_jupyter
``` import numpy as np np.random.seed(1) from numpy.linalg import cholesky as llt import matplotlib.pyplot as plt plt.rcParams.update({ "text.usetex": True, "font.family": "sans-serif", "font.sans-serif": ["Helvetica Neue"], "font.size": 28, }) def forward_substitution(L, b): n = L.shape[0] x = ...
github_jupyter
foo.039 Crop Total Nutrient Consumption http://www.earthstat.org/data-download/ file type: geotiff ``` # Libraries for downloading data from remote server (may be ftp) import requests from urllib.request import urlopen from contextlib import closing import shutil # Library for uploading/downloading data to/from S3 i...
github_jupyter
# Bring your own components (BYOC) Starting in V4 Clara train is based of MONAI from their website "The MONAI framework is the open-source foundation being created by Project MONAI. MONAI is a freely available, community-supported, PyTorch-based framework for deep learning in healthcare imaging. It provides domai...
github_jupyter
# Семинар 6 - Введение в простые модели ML Дополнительно понадобятся следующие библиотеки. Раскомментируйте код, чтобы установить их. ``` # !pip install -U scikit-learn # !pip install pandas ``` # Метрики ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as anima...
github_jupyter
``` HAM = 0 SPAM = 1 datadir = 'data/section 7' sources = [ ('beck-s.tar.gz', HAM), ('farmer-d.tar.gz', HAM), ('kaminski-v.tar.gz', HAM), ('kitchen-l.tar.gz', HAM), ('lokay-m.tar.gz', HAM), ('williams-w3.tar.gz', HAM), ('BG.tar.gz', SPAM), ('GP.tar.gz', SPAM), ('SH.tar.gz', SPAM) ] d...
github_jupyter
# Actividad: Clasificación de SPAM ¿Podemos clasificar un email como spam con árboles y/o ensambles? Usaremos la base de datos [UCI Spam database](https://archive.ics.uci.edu/ml/datasets/Spambase) Responda las preguntas y realice las actividades en cada uno de los bloques Entregas al correo phuijse@inf.uach.cl hast...
github_jupyter
# Amortized Neural Variational Inference for a toy probabilistic model Consider a certain number of sensors placed at known locations, $\mathbf{s}_1,\mathbf{s}_2,\ldots,\mathbf{s}_L$. There is a target at an unknown position $\mathbf{z}\in\mathbb{R}^2$ that is emitting a certain signal that is received at the $i$-th...
github_jupyter
# Assemble Perturb-seq BMDC data ``` import scanpy as sc import pandas as pd import scipy.io as io data_path = '/data_volume/memento/bmdc/' ``` ### Process time 0 ``` genes = pd.read_csv( data_path + 'raw0/GSM2396857_dc_0hr_genenames.csv', index_col=0) var_df = pd.DataFrame(index=genes['0'].str.split('_').str[1]...
github_jupyter
# Basics `reciprocalspaceship` provides methods for reading and writing MTZ files, and can be easily used to join reflection data by Miller indices. We will demonstrate these uses by loading diffraction data of tetragonal hen egg-white lysozyme (HEWL). ``` import reciprocalspaceship as rs print(rs.__version__) ``` T...
github_jupyter
# Caffe2 Basic Concepts - Operators & Nets In this tutorial we will go through a set of Caffe2 basics: the basic concepts including how operators and nets are being written. First, let's import caffe2. `core` and `workspace` are usually the two that you need most. If you want to manipulate protocol buffers generated ...
github_jupyter
<h1 align="center">Teoría Generalizada del Medio Efectivo de la Polarización Inducida: Inclusiones Esféricas</h1> <div align="right">Por David A. Miranda, PhD<br>2021</div> <h2>1. Importa las librerias</h2> ``` import numpy as np import matplotlib.pyplot as plt ``` # 2. Detalles teóricos La Teoría Generalizada del M...
github_jupyter
``` # Erasmus+ ICCT project (2018-1-SI01-KA203-047081) # Toggle cell visibility from IPython.display import HTML tag = HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide() } else { $('div.input').show() } code_show = !code_show } $( document...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.png) #...
github_jupyter
# Hide your messy video background using neural nets, Part 2 > "Using our trained model to blur the background of video frames with OpenCV." - toc: true - branch: master - badges: true - comments: false - categories: [fastai, privacy, opencv] - image: images/articles/2021-backgroundblur-2/thumbnail.jpg - hide: false ...
github_jupyter
``` from facenet_pytorch import MTCNN import cv2 from PIL import Image import numpy as np from matplotlib import pyplot as plt from tqdm.notebook import tqdm import matplotlib.image as mpimg os.getcwd() mtcnn = MTCNN(margin=20, keep_all=True, post_process=False, device='cuda:0') image = "test_image/6_faces.jpg" imag...
github_jupyter
# Part 1 - Introduction to Grid ##### Grid is a platform to **train**, **share** and **manage** models and datasets in a **distributed**, **collaborative** and **secure way**. &nbsp; Grid platform aims to be a secure peer to peer platform. It was created to use pysyft's features to perform federated learning pr...
github_jupyter
``` # @title Installation !curl -L https://raw.githubusercontent.com/facebookresearch/habitat-sim/master/examples/colab_utils/colab_install.sh | NIGHTLY=true bash -s !wget -c http://dl.fbaipublicfiles.com/habitat/mp3d_example.zip && unzip -o mp3d_example.zip -d /content/habitat-sim/data/scene_datasets/mp3d/ !pip unins...
github_jupyter
``` #importing libraries import pandas as pd import numpy as np import scipy.stats as stats import statsmodels.formula.api as smf ``` __Q1: Descriptive analysis__ __Q1.1: 1.1 Summary statistics__ ``` #Read the data data = pd.read_csv('progresa-sample.csv.bz2') #Checking all the columns of the data data.columns #Vali...
github_jupyter
``` # Author: Xiang Zhang (zhan6668) # Description: This IPython notebook pre-process the movie data for Avatar-Project1-Phase3 import os, sys, re import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy import stats # Design a function to rename the titles def renameTitle(x): title = x ...
github_jupyter
## Dependencies ``` !pip install --quiet /kaggle/input/kerasapplications !pip install --quiet /kaggle/input/efficientnet-git import warnings, glob from tensorflow.keras import Sequential, Model import efficientnet.tfkeras as efn from cassava_scripts import * seed = 0 seed_everything(seed) warnings.filterwarnings('ig...
github_jupyter
<p align="center"> <img src="https://github.com/GeostatsGuy/GeostatsPy/blob/master/TCG_color_logo.png?raw=true" width="220" height="240" /> </p> ## Demonstration of Lorenz Coefficient for Quantifying Spatial, Subsurface Heterogeneity #### Alan Scherman, Rice University, UT PGE 2020 SURI #### Supervised by: ###...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/streamlit_notebooks/healthcare/DEID_EHR_DATA.ipynb) # **De-identify Structu...
github_jupyter
# Beautiful Charts **Inhalt:** Etwas Chart-Formatierung **Nötige Skills:** Erste Schritte mit Pandas **Lernziele:** - Basic Parameter in der Plot-Funktion kennenlernen - Charts formatieren mit weiteren Befehlen - Intro für Ready-Made Styles und Custom Styles - Charts exportieren **Weitere Ressourcen:** - Alle Ress...
github_jupyter
# Microsoft Azure Computer Vision API with Python This Jupyter Notebook is almost a verbatim copy of that found here: - https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts/python In order to use this notebook, you must obtain a subscription key: - https://docs.microsoft.com/en-us/azur...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/JavaScripts/CloudMasking/Landsat8SurfaceReflectance.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> ...
github_jupyter
``` %load_ext autoreload %autoreload 2 from meijer import Meijer m = Meijer() self = m def get_list(self): request = dict() request["url"] = "https://mservices.meijer.com/listmanagement/api/list" request["headers"] = { "Accept": "application/meijer.shoppingList.ShoppingList-v1.0+json", } r =...
github_jupyter
# Working with brainsight module ``` from pynetstim.brainsight import BrainsightProject, chunk_samples, plot_chunks from pynetstim.plotting import plotting_points from pynetstim.coordinates import FreesurferCoords from pynetstim.freesurfer_files import Surf from pynetstim.utils import clean_plot import numpy as np imp...
github_jupyter
# Webscraping Color Palette ## Scraping rules - You should check a site's terms and conditions before you scrape them. It's their data and they likely have some rules to govern it. - Be nice - A computer will send web requests much quicker than a user can. Make sure you space out your requests a bit so that you don't ...
github_jupyter
## Copy your notebook version [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Building-ML-Pipelines/building-machine-learning-pipelines/blob/master/chapters/adv_tfx/Custom_TFX_Components.ipynb) Bit.ly: https://bit.ly/custom_TFX_components Colab: h...
github_jupyter
# Comparison of robustness curves for different models ``` import os os.chdir("../") import sys import json from argparse import Namespace import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import foolbox from sklearn import metrics from sklearn.metrics import pairwise_distances as dist impo...
github_jupyter
## 1. United Nations life expectancy data <p>Life expectancy at birth is a measure of the average a living being is expected to live. It takes into account several demographic factors like gender, country, or year of birth.</p> <p>Life expectancy at birth can vary along time or between countries because of many causes:...
github_jupyter
# Post-Processing <img src="../images/post-processing.png" alt="Drawing" style="width: 600px;"/> ``` from aif360.metrics.classification_metric import ClassificationMetric import matplotlib.pyplot as plt import pandas as pd import numpy as np from sklearn.metrics import accuracy_score from sklearn.linear_model import ...
github_jupyter
# 自动数据增强 ## 概述 MindSpore除了可以让用户自定义数据增强的使用,还提供了一种自动数据增强方式,可以基于特定策略自动对图像进行数据增强处理。 自动数据增强主要分为基于概率的自动数据增强和基于回调参数的自动数据增强。 ## 基于概率的自动数据增强 MindSpore提供了一系列基于概率的自动数据增强API,用户可以对各种数据增强操作进行随机选择与组合,使数据增强更加灵活。 关于API的详细说明,可以参见[API文档](https://www.mindspore.cn/doc/api_python/zh-CN/master/mindspore/mindspore.dataset.transforms.htm...
github_jupyter
# Modification of object properties ### Customize simulation The aim of this session is to give a better understanding of how our solver works. Most of all we will present different properties of the classes. This allows to set up very individual simulations, according to the interests one might have. We recommend t...
github_jupyter
``` import numpy as np DHESN_PCA = np.genfromtxt("DHESN_RESULTS/DHESN_data_VARIOUS_DHESN_WITH_PCA_2__2018-03-21.csv", delimiter=',', skip_header=1) print(DHESN_PCA) import pandas as pd data_vae_2 = pd.read_csv("DHESN_RESULTS/DHESN_data_DHESN_WITH_VAE_GRID_SEARCH_epochfix_3_nostd__2018-03-23.csv", delimiter=',') data_va...
github_jupyter
# BIDMC Datathon Question #1 # English vs. Non-English Speaker MIMIC-III Cohort # Notebook 2: Exploratory Analysis In this notebook, we want to walk you through some basic steps on how to analyze the cohort which we generated in the first notebook. This notebook is meant to simply introduce a few first steps towards ...
github_jupyter
# Load ranked hyper-params and join selections ### Import/init ``` import os import csv import numpy as np import pandas as pd from collections import defaultdict import matplotlib.pyplot as plt %matplotlib inline from notebook_helpers import load_params # Shared base path path = "/Users/type/Code/azad/data/wythof...
github_jupyter
<h1><center>Global stuff</center></h1> ``` # Eases updating libs %load_ext autoreload %autoreload 2 %matplotlib inline # Imports import sys sys.path.append('../') from IPython.display import clear_output IN_COLAB = 'google.colab' in sys.modules if IN_COLAB: from google.colab import drive drive.mount('/content/...
github_jupyter
``` # This notebook generates barplot with evaluation metrics for all groups specified in groups_eval variable. basic_metrics = {('wtkappa', 'trim'): [0.7], ('corr', 'trim'): [0.7], ('DSM', 'trim_round'): [0.1, -0.1], ('DSM', 'trim'): [0.1, -0.1], ('R2...
github_jupyter
``` # default_exp models ``` # Models > Tree ensemble and decision tree models. ``` #hide def extra_model_fn(): pass #export from decision_tree.imports import * from decision_tree.core import * from decision_tree.data import * ``` ## Decision Tree ``` #export class Node(): def __init__(self, depth, pred, s...
github_jupyter
# Scipy基本使用 本文主要介绍numpy之外的scipy的使用,参考: - [浅尝则止 - SciPy科学计算 in Python](https://zhuanlan.zhihu.com/p/102395401) SciPy以NumPy为基础,提供了众多数学、科学、工程计算用的模块,包括但不限于:线性代数、常微分方程求解、信号处理、图像处理、稀疏矩阵处理。 安装: ```Shell conda install -c conda-forge scipy ``` ## 常数 首先,看看物理常数,scipy包括了众多的物理常数。 ``` #Constants.py from scipy import constant...
github_jupyter
``` %cd -q data/actr_reco import pandas as pd import datetime import numpy as np data = [ ["user1", "song1", datetime.datetime(2000, 1, 1, 0)], ["user1", "song1", datetime.datetime(2000, 1, 1, 0)], ["user1", "song2", datetime.datetime(2000, 1, 1, 1)], ["user1", "song2", datetime.datetime(2000, 1, 1, 1)]...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm as tqdm %matplotlib inline import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import random from torch.util...
github_jupyter
# Trigonometry ``` import numpy as np import matplotlib.pyplot as plt ``` ## Contents - [Sine, cosine and tangent](#Sine_cosine_and_tangent) - [Measurements](#Measurements) - [Small angle approximation](#Small_angle_approximation) - [Trigonometric functions](#Trigonometric_functions) - [More trigonometric functions]...
github_jupyter
## __INTRODUCTION__ ### __ARTIFICIAL NEURAL NETWORKS__ * ML models that have a graph structure,inspired by the brain structure, with many interconnected units called artificial naurons https://www.youtube.com/watch?v=3JQ3hYko51Y * ANN have the ability to learn from raw data imputs, but it also makes them slower ...
github_jupyter
``` import random ``` The first parameter, learn_speed, is used to control how fast our perceptron will learn. The lower the value, the longer it will take to learn, but the less one value will change each overall weight. If this parameter is too high, our program will change its weights so quickly that they are inacc...
github_jupyter
``` import math import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.special import logit from IPython.display import display from keras.layers import (Input, Dense, Lambda, Flatten, Reshape, BatchNormalization, Layer, Activation, Dropout, Conv2D, Conv2DTranspose...
github_jupyter
*Analytical Information Systems* # Descriptive Statistics in R - Baseball Salaries Prof. Christoph M. Flath<br> Lehrstuhl für Wirtschaftsinformatik und Informationsmanagement SS 2019 <h1>Agenda<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Load-packages" data-toc-modifi...
github_jupyter
``` import pandas as pd import os, sys import numpy as np os.environ["KERAS_BACKEND"] = 'tensorflow' from keras.utils import np_utils from sklearn.ensemble import RandomForestClassifier import pickle from sklearn.externals import joblib pd.options.mode.chained_assignment = None # default='warn' import re from floor.da...
github_jupyter
``` import calendar from datetime import datetime as pydt import requests import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as mtick import matplotlib.dates as mdates import seaborn as sns plt.style.use('seaborn-dark') url = "https://api.midway.tomtom.com/ranking/liveHourly/ITA_rome" # Reque...
github_jupyter
# 使用Mask R-CNN模型实现人体关键节点标注 在之前的[Mask R-CNN](#)案例中,我们对Mask R-CNN模型的整体架构进行简介。Mask R-CNN是一个灵活开放的框架,可以在这个基础框架的基础上进行扩展,以完成更多的人工智能任务。在本案例中,我们将展示如何对基础的Mask R-CNN进行扩展,完成人体关键节点标注的任务。 ## Mask-RCNN模型的基本结构 也许您还记得我们之前介绍过的Mask R-CNN整体架构,它的3个主要网络: - backbone网络,用于生成特征图 - RPN网络,用于生成实例的位置、分类、分割(mask)信息 - head网络,对位置、分类和分割(mask)信息进行训练...
github_jupyter
``` import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset, DataLoader import matplotlib # matplotlib.use("Agg") import matplotlib.pyplot as plt import os import datetime import numpy as np from torch.nn import MSELoss # get data from Oscar, m...
github_jupyter
<a href="https://colab.research.google.com/github/abegpatel/movie-recomendation-system-using-auto-encoder/blob/master/autoencoder.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> **AUTO ENCODERS:** .auto encoders .training of an auto encoders .overco...
github_jupyter
# Running a Federated Cycle with Synergos In a federated learning system, there are many contributory participants, known as Worker nodes, which receive a global model to train on, with their own local dataset. The dataset does not leave the individual Worker nodes at any point, and remains private to the node. The j...
github_jupyter
# 应用自动数据增强 [![查看源文件](https://gitee.com/mindspore/docs/raw/master/resource/_static/logo_source.png)](https://gitee.com/mindspore/docs/blob/master/docs/notebook/mindspore_enable_auto_augmentation.ipynb) ## 概述 自动数据增强(AutoAugment)是在一系列图像增强子策略的搜索空间中,通过搜索算法找到适合特定数据集的图像增强方案。MindSpore的`c_transforms`模块提供了丰富的C++算子来实现AutoAugme...
github_jupyter
``` from google.colab import drive drive.mount('GoogleDrive') !fusermount -u GoogleDrive import tensorflow as tf import numpy as np import scipy.io as scio import os v_feature = scio.loadmat('./My_file_path') v_feature train_feature = v_feature['feature'] train_feature.shape train_label = v_feature['label'].flatten() t...
github_jupyter
<img src="../../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> # _*Qiskit Chemistry: Compiuting a Molecule's Dissociation Profile Using the Variational Quantum Eigensolver (VQE) Algorithm*_ The...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from scipy.linalg import expm ``` # Entanglement in the Stern-Gerlach Experiment In this problem we want to consider Stern-Gerlach experiment with a more realistic approach. Assume the electrons are shot towards the apparatus. The hamiltonian is as follows: $H = ...
github_jupyter
<img src="NotebookAddons/blackboard-banner.png" width="100%" /> <font face="Calibri"> <br> <font size="5"> <b>Change Detection in <font color='rgba(200,0,0,0.2)'>Your Own</font> SAR Amplitude Time Series Stack </b> </font> <br> <font size="4"> <b> Franz J Meyer; University of Alaska Fairbanks & Josef Kellndorfer, <a h...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt %matplotlib notebook df = pd.read_csv('BinSize_d{}.csv'.format(400)) station_locations_by_hash = df[df['hash'] == 'fb441e62df2d58994928907a91895ec62c2c42e6cd075c2700843b89'] lons = station_locations_by_hash['LONGITUDE'].tolist() lats = station_locations_by_hash['L...
github_jupyter
# Dask Array ### What is Dask Array? - Dask Array is composed of many NumPy or NumPy-like arrays (e.g. CuPy arrays) under the hood - Dask Array implements a subset of the NumPy ndarray API using blocked algorithms - These array may be streamed out of the disk of a single computer or multiple/distributed computers - Da...
github_jupyter
``` # General purpose libraries import boto3 import copy import csv import datetime import json import numpy as np import pandas as pd import s3fs from collections import defaultdict import time import re import random from sentence_transformers import SentenceTransformer import sentencepiece from scipy.spatial import ...
github_jupyter
``` from __future__ import print_function, division import numpy as np import matplotlib import matplotlib.pyplot as plt from scipy.optimize import curve_fit %matplotlib inline import pandas as pd ``` # Import data & initial guess ``` def create_filepaths(numbers, pre_path): padded_numbers = [] file_ext = '....
github_jupyter
# Comparing machine learning models in scikit-learn *From the video series: [Introduction to machine learning with scikit-learn](https://github.com/justmarkham/scikit-learn-videos)* ``` #environment setup with watermark %load_ext watermark %watermark -a 'Gopala KR' -u -d -v -p watermark,numpy,pandas,matplotlib,nltk,sk...
github_jupyter
# Importing Libraries ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline from imblearn.over_sampling import SMOTE ``` # Importing Dataset ``` data = pd.read_csv('MIES_Dev_Data/data.csv', '\t') data.head() for column in data.columns: print(column, ...
github_jupyter
``` %load_ext autoreload %autoreload 2 from calc_footprint_FFP_adjusted01 import FFP import matplotlib.pyplot as plt import numpy as np from shapely.geometry import Point from shapely.geometry.polygon import Polygon from matplotlib.path import Path import rasterio import rasterio.plot import rasterio.mask import ge...
github_jupyter
# Chapter 3 Conditional Execution ``` x = 10 # assignment x x == 10 # does x equal to 10? True/False ``` # one-way decision ``` x = 20 # sequentional print(x) # sequentional if x > 10: # sequentional (condition) print('x is big') # conditional print('the value of x is', x) # conditional print('done') # sequen...
github_jupyter
``` # ---------------------------------------------------- # Country Tally Plot # Generate a comprehensive set of plots to visualise # COVID-19 situation in a country. # # For more information, please go to: # https://github.com/MunchDev/EpidemicSimulator # ---------------------------------------------------- # Countr...
github_jupyter
# Kats 204 Forecasting with Meta-Learning This tutorial will introduce the meta-learning framework for forecasting in Kats. The table of contents for Kats 203 is as follows: 1. Overview of Meta-Learning Framework For Forecasting 2. Introduction to `GetMetaData` 3. Determining Predictability with `MetaLearnP...
github_jupyter
# PageRank In this notebook, you'll build on your knowledge of eigenvectors and eigenvalues by exploring the PageRank algorithm. The notebook is in two parts, the first is a worksheet to get you up to speed with how the algorithm works - here we will look at a micro-internet with fewer than 10 websites and see what it ...
github_jupyter
# Four Qubit Chip Design Creates a complete quantum chip and exports it ### Preparations The next cell enables [module automatic reload](https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html?highlight=autoreload). Your notebook will be able to pick up code updates made to the qiskit-metal (or ot...
github_jupyter
![qiskit_header.png](attachment:qiskit_header.png) # Quantum Process Tomography * **Last Updated:** June 17, 2019 * **Requires:** qiskit-terra 0.8, qiskit-ignis 0.1.1, qiskit-aer 0.2 This notebook contains examples for using the ``ignis.verification.tomography`` process tomography module. ``` # Needed for functions...
github_jupyter
--- title: "Card fraud model training" date: 2021-06-04 type: technical_note draft: false --- ## Create experiment ``` def experiment_wrapper(): import os import sys import uuid import random import tensorflow as tf from tensorflow.keras.callbacks import TensorBoard from hop...
github_jupyter
# Assignment 3 ## Implementation: EM and Gaussian mixtures ``` from __future__ import division import numpy as np import matplotlib.pyplot as plt from scipy.stats import multivariate_normal as mv_normal import matplotlib.mlab as mlab from scipy.stats import chi2 from matplotlib.patches import Ellipse ``` We start off...
github_jupyter
``` %matplotlib inline ``` Cross Compilation and RPC ========================= **Author**: `Ziheng Jiang <https://github.com/ZihengJiang/>`_, `Lianmin Zheng <https://github.com/merrymercy/>`_ This tutorial introduces cross compilation and remote device execution with RPC in TVM. With cross compilation and RPC, you...
github_jupyter
# Data Wrangling # Introduction This project focused on wrangling data from the WeRateDogs Twitter account using Python, documented in a Jupyter Notebook (wrangle_act.ipynb). This Twitter account rates dogs with humorous commentary. The rating denominator is usually 10, however, the numerators are usually greater th...
github_jupyter
``` import tensorflow as tf import numpy as np import keras import pandas as pd x_train = pd.read_csv('trainingfeatures.csv').drop(columns=['Unnamed: 0']) y_train = pd.read_csv('traininglabels.csv').drop(columns=['Unnamed: 0']) x_test = pd.read_csv('testingfeatures.csv').drop(columns=['Unnamed: 0']) y_test = pd.read_c...
github_jupyter
# Setup dell'ambiente e degli strumenti di lavoro Questo breve documento vi insegnerà le basi degli ambienti di lavoro necessari per questo corso. # Installare Python Cos'è Python? https://docs.python.org/3/tutorial/index.html Python è un linguaggio di programmazione potente e facile da imparare. Ha efficienti st...
github_jupyter
# Theano, Lasagne and why they matter ### got no lasagne? Install the __bleeding edge__ version from here: http://lasagne.readthedocs.org/en/latest/user/installation.html # Warming up * Implement a function that computes the sum of squares of numbers from 0 to N * Use numpy or python * An array of numbers 0 to N - n...
github_jupyter
# Density Functional Theory: Grid ## I. Theoretical Overview This tutorial will discuss the basics of DFT and discuss the grid used to evaluate DFT quantities. As with HF, DFT aims to solve the generalized eigenvalue problem: $$\sum_{\nu} F_{\mu\nu}C_{\nu i} = \epsilon_i\sum_{\nu}S_{\mu\nu}C_{\nu i}$$ $${\bf FC} = {\b...
github_jupyter
### Set GPU ``` import os os.environ['CUDA_VISIBLE_DEVICES'] = "3" ``` ## Set Dataset Name ``` # dataset_name = 'CIFAR10' # dataset_name = 'CIFAR100' # dataset_name = 'MNIST' # dataset_name = 'TINYIMAGENET' dataset_name = 'IMBALANCED_CIFAR10' ``` ### Run All Now ``` # from models.resnet_stl import resnet18 import ...
github_jupyter
# Pyspark Using pyspark from a Jupyter notebook is quite straightforward when using a local spark instance. This can be installed trivially using conda, i.e., ``` conda install pyspark ``` Once this is done, a local spark instance can be launched easily from within the notebook. ``` from pyspark import SparkContext...
github_jupyter
``` import numpy as np import pandas as pd import os import random import matplotlib import matplotlib.pyplot as plt import matplotlib.image as mpimg from sklearn.dummy import DummyRegressor from sklearn.metrics import r2_score import tensorflow as tf from tensorflow import keras from sklearn.model_selection import tra...
github_jupyter