text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
<a href="https://colab.research.google.com/github/wileyw/DeepLearningDemos/blob/master/SinGAN/DoubleGAN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # SinGAN [Official SinGAN Repository](https://github.com/tamarott/SinGAN) In this notebook, we ...
github_jupyter
# 12. Analysing proteins using python In previous sections we have primarily focused on showing you the basic components of python. We have primarily looked at small example cases where we process some type of input data to generate some kind of text or numerical output. In this section we want to show you how you c...
github_jupyter
<img src="../meta/logo.png" width=400 align="left"/> Contributors: - *Liubov Elkhovskaya* <span style="color:blue">lelkhovskaya@itmo.ru</span> - *Alexander Kshenin* <span style="color:blue">adkshenin@itmo.ru</span> - *Marina Balakhontceva* <span style="color:blue">mbalakhontceva@itmo.ru</span> - *Sergey Kovalchuk* <sp...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Data split Data splitting is one of the most vital tasks in assessing recommendation systems. Splitting strategy greatly affects the evaluation protocol so that it should always be taken into careful considerati...
github_jupyter
# Tutorial 1: Neural Nets and Datasets In this first tutorial, we'll cover the basics of training neural networks and loading/generating datasets. We've extended pytorch neural networks to have a bunch of handy tools. We'll need all these tools to evaluate Lipschitz constants. Since we frequently operate with neural ne...
github_jupyter
# Example: CanvasXpress correlation Chart No. 3 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/correlation-3.html This example is generated using the reproducible JSON obtained from the abo...
github_jupyter
# Personal Pools Launch this tutorial in a Jupyter Notebook on Binder: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/htcondor/htcondor-python-bindings-tutorials/master?urlpath=lab/tree/Personal-Pools.ipynb) A Personal HTCondor Pool is an HTCondor Pool that has a single owner, who is: - ...
github_jupyter
<table width="100%"> <tr style="border-bottom:solid 2pt #009EE3"> <td style="text-align:left" width="10%"> <a href="generation_of_time_axis.dwipynb" download><img src="../../images/icons/download.png"></a> </td> <td style="text-align:left" width="10%"> <a href="https:...
github_jupyter
##### Copyright 2020 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
TSG073 - InfluxDB logs ====================== Steps ----- ### Parameters ``` import re tail_lines = 2000 pod = None # All container = "influxdb" log_files = [ "/var/log/supervisor/log/influxdb*.log" ] expressions_to_analyze = [] ``` ### Instantiate Kubernetes client ``` # Instantiate the Python Kubernetes clien...
github_jupyter
<a href="https://colab.research.google.com/github/PGM-Lab/probai-2021-pyro/blob/main/Day1/notebooks/students_PPLs_Intro.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <img src="https://github.com/PGM-Lab/probai-2021-pyro/blob/main/Day1/Figures/blue...
github_jupyter
# DATA WRANGLING AND CLEANING #### Data wrangling is the process of cleaning, structuring and enriching raw data into a desired format for better decision making in less time. Data wrangling is increasingly ubiquitous at today’s top firms. Data has become more diverse and unstructured, demanding increased time spent ...
github_jupyter
Copyright (C) 2017 Ashish Gupta<br> <br> This program is free software: you can redistribute it and/or modify<br> it under the terms of the GNU General Public License as published by<br> the Free Software Foundation, either version 3 of the License, or<br> (at your option) any later version.<br> <br> This program is di...
github_jupyter
# 5.9 含并行连结的网络(GoogLeNet) ``` import time import torch from torch import nn, optim import torch.nn.functional as F import sys sys.path.append("..") import d2lzh_pytorch as d2l device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') print(torch.__version__) print(device) ``` ## 5.9.1 Inception 块 ``` ...
github_jupyter
# Modeling and Simulation in Python Chapter 23 Copyright 2017 Allen Downey License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0) ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an a...
github_jupyter
``` import matplotlib.pyplot as plt %matplotlib inline ``` # Functions For Reading Tint Data ``` import struct import numpy.matlib def getspikes(fullpath): """ This function will return the spike data, spike times, and spike parameters from Tint tetrode data. Example: tetrode_fullpath = 'C:\\exam...
github_jupyter
# A brief intro to pydeck pydeck is made for visualizing data points in 2D or 3D maps. Specifically, it handles - rendering large (>1M points) data sets, like LIDAR point clouds or GPS pings - large-scale updates to data points, like plotting points with motion - making beautiful maps Under the hood, it's powered by...
github_jupyter
# Jupyter Notebook Jupyter Notebooks is a good place to start new python experiences... This page is self-editable, feel free to play... * CTRL-Enter => Run a cells. * CTRL-S => Save your notebooks. * H => More shortcuts... What is it good for? * Interactive documentation. * Send-boxes. * Write documented tests. ...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import numpy as np import seaborn as sns from sklearn.model_selection import GridSearchCV from sklearn.metrics import roc_curve from sklearn.metrics import auc from sklearn.metrics import accuracy_score import pickle from sklearn.metrics import r2_score from sklea...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import os import cv2 from numpy import linalg as LA def list_files(directory): if os.path.exists(directory) == False: return None return [x for x in os.listdir(directory) if os.path.isfile(os.path.join(directory, x))] def LoadImageData(dPath, fil...
github_jupyter
# Model Fitting - XGBoost Fit the XGBoost model using the training dataset. XGBoost is faster and has potentially better accuracy. This allow me to use more features and test changes faster. ``` %load_ext autoreload %autoreload 2 %matplotlib notebook import numpy as np from numpy import mean from numpy import std fr...
github_jupyter
This program will prepare a basic automation routine for functionalizing CO molecules on a clean Cu(111) surface. This program is provided to demonstrate of the automation capabilities for CO-AFM utilizing a CreaTec STM/AFM system. Programs from other publications may provide fully-autonomous construction and tip-pre...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import wikipedia import xml.etree.ElementTree as ET import re from sklearn.manifold import TSNE from sklearn.decomposition import PCA from sklearn.model_selection import cross_val_score, KFold import xgboost as xgb from sklearn.metrics import r2...
github_jupyter
``` try: from openmdao.utils.notebook_utils import notebook_mode except ImportError: !python -m pip install openmdao[notebooks] ``` # ExecComp `ExecComp` is a component that provides a shortcut for building an ExplicitComponent that represents a set of simple mathematical relationships between inputs and out...
github_jupyter
### Generating `publications.json` partitions This is a template notebook for generating metadata on publications - most importantly, the linkage between the publication and dataset (datasets are enumerated in `datasets.json`) Process goes as follows: 1. Import CSV with publication-dataset linkages. Your csv should h...
github_jupyter
# Bootstrap distances to the future Estimate uncertainty of distance to the future values per sample and model using the bootstrap of observed distances across time. ## Define inputs, outputs, and parameters ``` # Define inputs. model_distances = snakemake.input.model_distances # Define outputs. output_table = snak...
github_jupyter
``` import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.metrics import mean_squared_error from xgboost import XGBRegressor import optuna df = pd.read_csv("../input/30days-folds/train_folds.csv") df_test = pd.read_csv("../input/30-days-of-ml/test.csv") sample_submission = pd.read_csv("....
github_jupyter
``` import pandas as pd import numpy as np from typing import List, Union from scipy.special import erf, binom from statdepth.depth._depthcalculations import _subsequences def _norm_cdf(x: np.array, mu: float, sigma: float): """ Estimate the CDF at x for the normal distribution parametrized by mu and sigma^2...
github_jupyter
# AR6 WG1 - SPM.4 This notebook reproduces the panel a) of **Figure SPM.4** of the IPCC's *Working Group I contribution to the Sixth Assessment Report* ([AR6 WG1](https://www.ipcc.ch/assessment-report/ar6/)). The data supporting the SPM figure is published under a Creative Commons CC-BY license at the [Centre for En...
github_jupyter
# Linear Regression Example from [Introduction to Computation and Programming Using Python](https://mitpress.mit.edu/books/introduction-computation-and-programming-using-python-revised-and-expanded-edition) ``` import matplotlib.pyplot as plot from numpy import ( array, asarray, correlate, cov, ge...
github_jupyter
Example 4 - Anisotropic Bearings. ==== In this example, we use the rotor seen in Example 5.9.2 from 'Dynamics of Rotating Machinery' by MI Friswell, JET Penny, SD Garvey & AW Lees, published by Cambridge University Press, 2010. Both bearings have a stiffness of 1 MN/m in the x direction and 0.8 MN/m in the y directio...
github_jupyter
# Heterogeneous Effects > **Author** - [Paul Schrimpf *UBC*](https://economics.ubc.ca/faculty-and-staff/paul-schrimpf/) **Prerequisites** - [Regression](regression.ipynb) - [Machine Learning in Economics](ml_in_economics.ipynb) **Outcomes** - Understand potential outcomes and treatment effects - Apply gene...
github_jupyter
# Construction of Regression Models using Data Author: Jerónimo Arenas García (jarenas@tsc.uc3m.es) Jesús Cid Sueiro (jcid@tsc.uc3m.es) Notebook version: 2.1 (Sep 27, 2019) Changes: v.1.0 - First version. Extracted from regression_intro_knn v.1.0. v.1.1 - Compatibility with pyth...
github_jupyter
# Web Data Scraping [Spring 2021 ITSS Mini-Course](https://www.colorado.edu/cartss/programs/interdisciplinary-training-social-sciences-itss/mini-course-web-data-scraping) — ARSC 5040 [Brian C. Keegan, Ph.D.](http://brianckeegan.com/) [Assistant Professor, Department of Information Science](https://www.colorado.edu...
github_jupyter
Copyright © 2017-2021 ABBYY Production LLC ``` #@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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
github_jupyter
# Descriptor Example: Attribute Validation ## LineItem Take #3: A Simple Descriptor ``` class Quantity: def __init__(self, storage_name): self.storage_name = storage_name def __set__(self, instance, value): if value > 0: instance.__dict__[self.storage_name] = value ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.metrics import mean_squared_error,r2_score from sklearn.preprocessing import MinMaxScaler from scipy.stats import iqr from keras.models import load_model from keras.models import Sequential from keras.models import Model from keras...
github_jupyter
# Introduction to GeoPandas This quick tutorial introduces the key concepts and basic features of GeoPandas to help you get started with your projects. ## Concepts GeoPandas, as the name suggests, extends the popular data science library [pandas](https://pandas.pydata.org) by adding support for geospatial data. If y...
github_jupyter
# Advanced Usage Exampes for Seldon Client ## Istio Gateway Request with token over HTTPS - no SSL verification Test against a current kubeflow cluster with Dex token authentication. 1. Install kubeflow with Dex authentication ``` INGRESS_HOST=!kubectl -n istio-system get service istio-ingressgateway -o jsonpath='...
github_jupyter
## Introduction to PySpark This article aims to give hands on experience in working with the DataFrame API in PySpark. You can download this article as a notebook and run the code yourself by clicking on the download button above and selecting `.ipynb`. We will not aim to cover all the PySpark DataFrame functionality...
github_jupyter
``` # import libraries import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.datasets as datasets import torchvision.transforms as transforms from torch.utils.data.sampler import SubsetRandomSampler import numpy as np from tqdm import tqdm from torch.utils.tensorboard i...
github_jupyter
# Sentiment Analysis with TreeLSTMs in TensorFlow Fold The [Stanford Sentiment Treebank](http://nlp.stanford.edu/sentiment/treebank.html) is a corpus of ~10K one-sentence movie reviews from Rotten Tomatoes. The sentences have been parsed into binary trees with words at the leaves; every sub-tree has a label ranging fr...
github_jupyter
Lists and Tuples === In this notebook, you will learn about lists, a super important data structure, that allows you to store more than one value in a single variable. This is one of the most powerful ideas in programming and introduces a number of other central concepts such as loops. [Previous: Variables, Strings, a...
github_jupyter
# Operations on word vectors Welcome to your first assignment of this week! Because word embeddings are very computionally expensive to train, most ML practitioners will load a pre-trained set of embeddings. **After this assignment you will be able to:** - Load pre-trained word vectors, and measure similarity usi...
github_jupyter
# **Birth weight prediction** --- ## Load Libraries ``` import os import numpy as np import pandas as pd import seaborn as sn import matplotlib.pyplot as plt from joblib import dump, load from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.metrics impor...
github_jupyter
``` from IPython.display import HTML # Cell visibility - COMPLETE: #tag = HTML('''<style> #div.input { # display:none; #} #</style>''') #display(tag) #Cell visibility - TOGGLE: tag = HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide() } else { $(...
github_jupyter
# Name Deploying a trained model to Cloud Machine Learning Engine # Label Cloud Storage, Cloud ML Engine, Kubeflow, Pipeline # Summary A Kubeflow Pipeline component to deploy a trained model from a Cloud Storage location to Cloud ML Engine. # Details ## Intended use Use the component to deploy a trained mo...
github_jupyter
# MSTICpy - Mordor data provider and browser ### Description This notebook provides a guided example of using the Mordor data provider and browser included with MSTICpy. For more information on the Mordor data sets see the [Open Threat Research Forge Mordor GitHub repo](https://github.com/OTRF/mordor) You must have ...
github_jupyter
``` import tensorflow as tf ``` tf.train.Coordinator: help multiple thread stop together and report exceptions to a program that waits for them to stop. tf.train.QueueRunner: create a number of threads cooperatiing to **enqueue** tensors in the **same** queue. ## Coordinator ### Key method tf.train.Coordinator.sho...
github_jupyter
``` class Opion(): def __init__(self): self.dataroot= r'I:\irregular holes\paris_eval_gt' #image dataroot self.maskroot= r'I:\irregular holes\testing_mask_dataset'#mask dataroot self.batchSize= 1 # Need to be set to 1 self.fineSize=256 # image size self.in...
github_jupyter
#Errors and Exception Handling In this lecture we will learn about Errors and Exception Handling in Python. You've definitely already encountered errors by this point in the course. For example: ``` print 'Hello ``` Note how we get a SyntaxError, with the further description that it was an EOL (End of Line Error) wh...
github_jupyter
### Problem Statement The task is to predict whether a potential promotee at checkpoint in the test set will be promoted or not after the evaluation process. ``` import pandas as pd import numpy as np import xgboost as xgb from xgboost.sklearn import XGBClassifier from sklearn import cross_validation, metrics from sk...
github_jupyter
# Sentiment Analysis Using RNN We use an Sequential LSTM to create a supervised learning approach for predicting the sentiment of an article. This notebook was adapted from https://www.kaggle.com/ngyptr/lstm-sentiment-analysis-keras. #### Data and Packages Importing ``` import numpy as np import pandas as pd from s...
github_jupyter
## Section 7.1: A First Plotly Streaming Plot Welcome to Plotly's Python API User Guide. > Links to the other sections can be found on the User Guide's [homepage](https://plot.ly/python/user-guide#Table-of-Contents:) Section 7 is divided, into separate notebooks, as follows: * [7.0 Streaming API introduction](http...
github_jupyter
<a href="https://colab.research.google.com/github/maragraziani/interpretAI_DigiPath/blob/main/hands-on-session-2/hands-on-session-2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # <center> Hands-on Session 2</center> ## <center> Explainable Graph ...
github_jupyter
<a href="https://colab.research.google.com/github/jonkrohn/ML-foundations/blob/master/notebooks/single-point-regression-gradient.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Gradient of a Single-Point Regression In this notebook, we calculate ...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Automated Machine Learning _**Text Classification Using Deep Learning**_ ## Contents 1. [Introduction](#Introduction) 1. [Setup](#Setup) 1. [Data](#Data) 1. [Train](#Train) 1. [Evaluate](#Evaluate) ## Introduction This noteb...
github_jupyter
# How do I _create_, _start_, & _monitor_ a task? ### Overview We are getting into advanced techniques here and will need to leverage a few other cookbooks. You will need an app and some files in your project, then it is easy to start one. The beginning of this notebook **replicates** the <a href="tasks_create.ipynb"> ...
github_jupyter
``` import pandas as pd import sqlalchemy import multiprocessing import numpy as np data = pd.read_excel('data/Budget-2018-19_Corrected.xlsx') data.head() data.columns = data.iloc[1] data.drop([0,1], axis=0, inplace=True) data.head() data.columns data['HEAD OF ACCOUNT'].head() # Scheme Names schemes = {'CSS': 'Centrall...
github_jupyter
## Logisitic Regression classifier with L2 Regularization ### Load the libraries ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import LabelEncoder from sklearn...
github_jupyter
``` import torch import random import torchvision from torch.utils.data import Dataset, DataLoader import torch.nn as nn import torch.nn.functional as F import argparse,os,time import os import time import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import trai...
github_jupyter
<a href="https://colab.research.google.com/github/kevincong95/cs231n-emotiw/blob/master/notebooks/audio/1.0-la-audio-error-analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !git clone 'https://github.com/kevincong95/cs231n-emotiw.git' ``...
github_jupyter
# Interpret Models You can use Azure Machine Learning to interpret a model by using an *explainer* that quantifies the amount of influence each feature contribues to the predicted label. There are many common explainers, each suitable for different kinds of modeling algorithm; but the basic approach to using them is t...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import xgboost as xgb import math from sklearn.model_selection import train_test_split from datetime import datetime import matplotlib.pyplot as plt %matplotlib inline df_train = pd.read_csv("../data/train.c...
github_jupyter
``` import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt %matplotlib inline ``` ### Device configuration ``` # device configuration device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') ``` ### Hyper parameters ``` # hy...
github_jupyter
(pandas_intro)= # Introduction ```{index} Pandas: basics ``` [Pandas](https://pandas.pydata.org/docs/) is an open source library for Python that can be used for data manipulation and analysis. If your data can be put into a spreadsheet, Pandas is exactly what you need! Pandas is a very powerful tool with highly opt...
github_jupyter
### train ``` import multiprocessing import threading import tensorflow as tf from agent.access import Access from agent.main import Agent NUMS_CPU = multiprocessing.cpu_count() state_size = 58 batch_size = 50 action_size = 3 max_episodes = 1 GD = {} class Worker(Agent): def __init__(self, name, access, batch_size...
github_jupyter
# String Formatting String formatting lets you inject items into a string rather than trying to chain items together using commas or string concatenation. As a quick comparison, consider: player = 'Thomas' points = 33 'Last night, '+player+' scored '+str(points)+' points.' # concatenation f...
github_jupyter
# The Exponential Distribution and the Poisson Process ## Introduction One simplifying assumption that is often made is to assume that certain $r.v.\DeclareMathOperator*{\argmin}{argmin} \DeclareMathOperator*{\argmax}{argmax} \DeclareMathOperator*{\plim}{plim} \newcommand{\using}[1]{\stackrel{\mathrm{#1}}{=}} \newcomm...
github_jupyter
# Nonlinear Equations We want to find a root of the nonlinear function $f$ using different methods. 1. Bisection method 2. Newton method 3. Chord method 4. Secant method 5. Fixed point iterations ``` %matplotlib inline from numpy import * from matplotlib.pyplot import * import sympy as sym t = sym.symbols('t') f_sy...
github_jupyter
# Example: Human segmentation with TransUnet and transfer learning from ImageNet-trained VGG16 model ``` import numpy as np from glob import glob import tensorflow as tf from PIL import Image import matplotlib.pyplot as plt from tensorflow import keras from keras.models import load_model from keras_unet_collection imp...
github_jupyter
# Introduction to Modeling Libraries ``` import numpy as np import pandas as pd np.random.seed(12345) import matplotlib.pyplot as plt plt.rc('figure', figsize=(10, 6)) PREVIOUS_MAX_ROWS = pd.options.display.max_rows pd.options.display.max_rows = 20 np.set_printoptions(precision=4, suppress=True) ``` ## Interfacing Be...
github_jupyter
# Neural Network **Learning Objectives:** * Use the `DNNRegressor` class in TensorFlow to predict median housing price The data is based on 1990 census data from California. This data is at the city block level, so these features reflect the total number of rooms in that block, or the total number of people who liv...
github_jupyter
# Heat equation Numerical resolution of the one-dimensional heat equation: $$ \alpha \frac{\partial^2 p}{\partial x^2} = \frac{\partial^2 p}{\partial t} $$ with given boundary conditions in the ending points of a line. ``` #We'll need these libraries import numpy as np import matplotlib.pyplot as plt from mpl_toolk...
github_jupyter
# End-to-End Machine Leanrning Project In this chapter you will work through an example project end to end, pretending to be a recently hired data scientist at a real estate company. Here are the main steps you will go through: 1. Look at the big picture 2. Get the data 3. Discover and visualize the data to gain insig...
github_jupyter
# Relativistic Kinematics Tutorial ## Brief Intro to Special Relativity Before talking about relativisic kinematics, let's briefly run through Einstein's theories of Special and General Relavitity. Einstein's theory of special relativity was derived from the following two postulates: * Postulate 1: The laws of physi...
github_jupyter
``` # Copyright 2021 Google LLC # # 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 agreed to in writi...
github_jupyter
``` top_directory = '/Users/iaincarmichael/Dropbox/Research/law/law-net/' from __future__ import division import os import sys import time from math import * import copy import cPickle as pickle # data import numpy as np import pandas as pd # viz import matplotlib.pyplot as plt # graph import igraph as ig # NLP...
github_jupyter
# Determining the difference in variant calling in human-only samples `004` and `005` **Gregory Way 2018** Samples `004` and `005` are human tumors. They were previously included in the entire `disambiguate` pipeline, where the WES reads were aligned to both human and mouse genomes. In the pipeline, all WES reads ar...
github_jupyter
<a href="https://colab.research.google.com/github/jwkanggist/EverybodyTensorflow2.0/blob/master/lab24_basic_bilstm_timepredict_tf2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # LAB24: Basic BiLSTM to Predict Time Series - Train a basic BiLSTM to...
github_jupyter
``` import open3d as o3d import numpy as np import os import sys # monkey patches visualization and provides helpers to load geometries sys.path.append('..') import open3d_tutorial as o3dtut # change to True if you want to interact with the visualization windows o3dtut.interactive = not "CI" in os.environ ``` # Multi...
github_jupyter
# Coupling a Landlab groundwater with a Mesa agent-based model This notebook shows a toy example of how one might couple a simple groundwater model (Landlab's `GroundwaterDupuitPercolator`, by [Litwin et al. (2020)](https://joss.theoj.org/papers/10.21105/joss.01935)) with an agent-based model (ABM) written using the [...
github_jupyter
``` import numpy as np import torch import random device = 'cuda' if torch.cuda.is_available() else 'cpu' import os,sys opj = os.path.join from tqdm import tqdm # import acd from random import randint from copy import deepcopy import pickle as pkl import argparse sys.path.append('../../lib/disentangling-vae') import m...
github_jupyter
## Compressing Word Embeddings Downloadable version of GloVe embedding (with fallback source). Then require two main sections : * Lloyd embedding generation * Sparsified embedding generation and then saving of the created embeddings to ```.hkl``` files. ### Download Source Embedding(s) The following needs to...
github_jupyter
``` %load_ext autoreload %autoreload 2 from metrics import CorefEvaluator from document import Document import json import os from ClEval import ClEval, print_clusters from datetime import datetime def get_timestamp(): return str(datetime.timestamp(datetime.now())).split('.')[0] get_timestamp() ``` # Dummy text ...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') #run import os import re import gc import json import glob import math import time import torch import os,sys import random import string import pickle import logging import itertools import unicodedata import torch.nn as nn from fastai.imports import * ...
github_jupyter
# Joint TV for multi-contrast MR This demonstration shows how to do a synergistic reconstruction of two MR images with different contrast. Both MR images show the same underlying anatomy but of course with different contrast. In order to make use of this similarity a joint total variation (TV) operator is used as a reg...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/get_image_resolution.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" h...
github_jupyter
``` %matplotlib inline import importlib importlib.reload(RooFitMP_analysis) import RooFitMP_analysis import numpy as np import pandas as pd import matplotlib.pyplot as plt import glob from RooFitMP_analysis import * df_split_timings_1538069 = build_comb_df_split_timing_info('../rootbench/1538069.burrell.nikhef.nl.out...
github_jupyter
## Importing UK Postcodes into Amazon Lex to create a custom slot This is a sample notebook that shows how to use pandas together the AWS Python SDK, boto3, to process a publicly available postcode file, sample it and create/update a custom slot type in Amazon Lex using the sample to train for slot recognition. I am...
github_jupyter
<a href="https://colab.research.google.com/github/Het-Shah/Meme-Classification/blob/master/nnfl_proj_v1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !nvidia-smi import tensorflow as tf device_name = tf.test.gpu_device_name() if device_name !...
github_jupyter
# Malware Classification **Data taken from**<br> https://github.com/Te-k/malware-classification Here is the plan that we will follow : - Extract as many features as we can from binaries to have a good training data set. The features have to be integers or floats to be usable by the algorithms - Identify the best f...
github_jupyter
# Welcome to PySyft The goal of this notebook is to provide step by step explanation of the internal workings of PySyft for developers and have working examples of the API to play with. **Note:** You should be able to run these without any issues. This notebook will be automatically run by CI and flagged if it fails....
github_jupyter
``` # Uncomment and run this cell if you're on Colab or Kaggle # !git clone https://github.com/nlp-with-transformers/notebooks.git # %cd notebooks # from install import * # install_requirements() #hide from utils import * setup_chapter() ``` # Multilingual Named Entity Recognition ## The Dataset ``` #id jeff-dean-ne...
github_jupyter
# Lesson 1 - FastAI ## New to ML? Don't know where to start? Machine learning may seem complex at first, given the math, background understanding, and code involved. However, if you truly want to learn, the best place to start is by building and messing around with a model. FastiAI makes it super easy to create and m...
github_jupyter
# Optical Flow Optical flow tracks objects by looking at where the *same* points have moved from one image frame to the next. Let's load in a few example frames of a pacman-like face moving to the right and down and see how optical flow finds **motion vectors** that describe the motion of the face! As usual, let's fi...
github_jupyter
# 1. Import Library ``` from keras.datasets import cifar10 import numpy as np np.random.seed(10) ``` # 資料準備 ``` (x_img_train,y_label_train),(x_img_test,y_label_test)=cifar10.load_data() print("train data:",'images:',x_img_train.shape, " labels:",y_label_train.shape) print("test data:",'images:',x_img_test.sh...
github_jupyter
# Detecting and examining gender bias in the MIND dataset The primary goal of this project is to build metrics of bias (here focusing on gender bias). Author: <b>Jamell Dacon</b> (daconjam@msu.edu) ``` import pandas as pd import sys import matplotlib.pyplot as plt %matplotlib inline import nltk from nltk.tokenize...
github_jupyter
# Using Interrupts and asyncio for Buttons and Switches This notebook provides a simple example for using asyncio I/O to interact asynchronously with multiple input devices. A task is created for each input device and coroutines used to process the results. To demonstrate, we recreate the flashing LEDs example in the ...
github_jupyter
# The number of cats You are working on a natural language processing project to determine what makes great writers so great. Your current hypothesis is that great writers talk about cats a lot. To prove it, you want to count the number of times the word "cat" appears in "Alice's Adventures in Wonderland" by Lewis Carr...
github_jupyter