text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` %matplotlib inline %load_ext autoreload %autoreload 2 import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd import matplotlib.pyplot as plt import networkx as nx import utils # local file plt.rcParams['font.family'] = 'serif' plt.rcParams['font.size'] = 17.0 plt.rc('text', usete...
github_jupyter
# IASI Data Experiment ``` import sys sys.path.append('/home/emmanuel/projects/2019_egp/src') from data.iasi import IASIOrbits, create_dataarray from experiments.experiment_iasi import GPModels from models.gp_models import SparseGP import GPy import numpy as np import pandas as pd import xarray as xr import matplotlib...
github_jupyter
# Testing differences between groups ``` # Import numerical, data and plotting libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') # Only show 4 decimals when printing np.set_printoptions(precision=4) # Show the plots in the notebook %matplotlib inline ``` ...
github_jupyter
# Deep Neural Network for Image Classification: Application When you finish this, you will have finished the last programming assignment of Week 4, and also the last programming assignment of this course! You will use use the functions you'd implemented in the previous assignment to build a deep network, and apply i...
github_jupyter
# Portfolio Optimization - ํฌํŠธํด๋ฆฌ์˜ค ์ตœ์ ํ™” ์ด๋ก ์— ๋Œ€ํ•œ ์ •๋ฆฌ ์ž๋ฃŒ - **ํฌํŠธํด๋ฆฌ์˜ค**๋ž€, ๋‹ค์–‘ํ•œ ์ž์‚ฐ์— ๋ถ„์‚ฐํ•˜์—ฌ ํˆฌ์žํ•˜๋Š” ๊ฒƒ์„ ๋งํ•จ - **๋ถ„์‚ฐํˆฌ์ž**๋ฅผ ํ†ตํ•ด ๋ณ€๋™์„ฑ๊ณผ ์œ„ํ—˜์„ ๋‚ฎ์ถœ ์ˆ˜ ์žˆ์Œ (๊ณ„๋ž€์„ ํ•œ ๋ฐ”๊ตฌ๋‹ˆ์— ๋‹ด์ง€ ๋ง๋ผ) - **์ž์‚ฐ ๋ฐฐ๋ถ„์ด๋ž€?** ์œ„ํ—˜ ๋Œ€๋น„ ์ˆ˜์ต์„ ์ตœ๋Œ€ํ™”ํ•˜๋Š” ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๊ฒƒ --- #### Tactical Asset Allocation(TAA) - ์œ„ํ—˜ ๋Œ€๋น„ ์ˆ˜์ต์„ "๋‹จ๊ธฐ์ ์œผ๋กœ" ์ตœ๋Œ€ํ™” - Smart Beta... #### Strategic Asset Allocation(SAA) - ์œ„ํ—˜ ๋Œ€๋น„ ์ˆ˜์ต์„ "์žฅ๊ธฐ์ ...
github_jupyter
# Improved feature engineering *Anders Poirel - 11-02-2020* Ideas I'll be building on - seperating by city (data has different structure between the cities, avoids needing to build a more complex model that captures feature interactions) - using the lifecycle of the mosquito: new mostiquos become adults 1-3 weeks afte...
github_jupyter
# T1499.002 - Service Exhaustion Flood Adversaries may target the different network services provided by systems to conduct a DoS. Adversaries often target DNS and web services, however others have been targeted as well.(Citation: Arbor AnnualDoSreport Jan 2018) Web server software can be attacked through a variety of ...
github_jupyter
``` ''' IMPORTS, RELOAD THIS BLOCK WHEN NEEDED ''' from IPython.display import display from GoogleImageSpider import * from FaceClassifier import * from ImageClassifier import * import certifi, urllib3 import time import json import os path = "trump_images" start_time = time.time() def print_time(): # TIMING CON...
github_jupyter
# T1018 - Remote System Discovery Adversaries may attempt to get a listing of other systems by IP address, hostname, or other logical identifier on a network that may be used for Lateral Movement from the current system. Functionality could exist within remote access tools to enable this, but utilities available on the...
github_jupyter
# BERT finetuning on Yelp NYC data BERT, or Bidirectional Encoder Representations from Transformers, is a new method of fine tuning a pre-trained language model for specific NLP tasks. It has been shown to beat the SOTA methods in almost every domain, and is highly adaptable to a wide range of tasks. In this notebook,...
github_jupyter
## Facial Filters Using your trained facial keypoint detector, you can now do things like add filters to a person's face, automatically. In this optional notebook, you can play around with adding sunglasses to detected face's in an image by using the keypoints detected around a person's eyes. Checkout the `images/` di...
github_jupyter
# Acme: Quickstart ## Guide to installing Acme and training your first D4PG agent. # <a href="https://colab.research.google.com/github/deepmind/acme/blob/master/examples/quickstart.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Select your envir...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/system-design-primer). # Design a call center ## Constraints and assumptions * What levels of employees are in the call center? * Operator, supervisor, director * Ca...
github_jupyter
# Fixpoint Quantization and Overflow # This notebook shows how number can be represented in binary format and how to (re-)quantize signals. This is also shown practically in Python using ``pyfda_fix_lib`` (numpy based). Most images don't show in the github HTML at the moment (05/2020). Running the notebook locally wor...
github_jupyter
# Recurrent Neural Nets - Fake News The RNN (LSTM) architechture that we are using is shown below, a many to one RNN. ![RNNs](./images/manytoone.jpg) <img src='https://media.giphy.com/media/l0Iyau7QcKtKUYIda/giphy.gif'> We achieve 87% accuracy in a test set. However, the article in Second reference claims to have 9...
github_jupyter
# Leave-One-Patient-Out classification of individual volumes Here, we train a classifier for each patient, based on the data of all the other patients except the current one (Leave One Out Cross-Validation). To this end, we treat each volume as an independent observation, so we have a very large sample of volumes whic...
github_jupyter
``` import numpy as np import tensorflow as tf assert tf.__version__.startswith('2') from tensorflow_examples.lite.model_maker.core.data_util.image_dataloader import ImageClassifierDataLoader from tensorflow_examples.lite.model_maker.core.task import image_classifier from tensorflow_examples.lite.model_maker.core.tas...
github_jupyter
# BOW Featurization and modeling ``` import pandas as pd import numpy as np import re from tqdm import tqdm import warnings from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics import accuracy_score, confusion_matrix, classification_report from sklearn.naive_bayes import MultinomialNB from ...
github_jupyter
# DataFrames We can think of a DataFrame as a bunch of Series objects put together to share the same index. Let's use pandas to explore this topic! ``` import pandas as pd import numpy as np from numpy.random import randn np.random.seed(101) df = pd.DataFrame(randn(5,4),index='A B C D E'.split(),columns='W X Y Z'.spl...
github_jupyter
# Problem set 5: Writing your own algorithms [<img src="https://mybinder.org/badge_logo.svg">](https://mybinder.org/v2/gh/NumEconCopenhagen/exercises-2020/master?urlpath=lab/tree/PS5/problem_set_5.ipynb) This problem set has no tasks, but only problems of increasing complexity. See how far you can get :) ``` import ...
github_jupyter
# Segundo parcial tema A __U.N.L.Z. - Facultad de Ingenierรญa__ __Electrotecnia__ __Alumno:__ Daniel Antonio Lorenzo <mark><strong>(Resoluciรณn en python3)</strong></mark> <a href="https://colab.research.google.com/github/daniel-lorenzo/Electrotecnia/blob/master/Ejercitacion/2do_parc_tema_A.ipynb"><i...
github_jupyter
# Imports ``` from pathlib import Path import mlflow import mlflow.spark import pandas as pd from pyspark.ml.feature import StringIndexer, OneHotEncoder, VectorAssembler from pyspark.ml.regression import LinearRegression, RandomForestRegressor from pyspark.ml.evaluation import RegressionEvaluator from pyspark.ml imp...
github_jupyter
# Jupyter Notebook Fundamentals A **notebook** is a collection **cells**. These cells are run to execute code, render formatted text or display graphical visualizations. ## Understanding Code Cells and Markdown Cells The following cell (with the gray text area) is a code cell. ``` # This is a code cell # By default...
github_jupyter
# Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone your intuitions about deep learning....
github_jupyter
``` import torch import torch.nn as nn from torchinfo import summary def build_circle_segmenter(): circle_segmenter = nn.Sequential( nn.Conv2d( in_channels=1, out_channels=8, kernel_size=3, stride=1, padding=1 ), nn.ReLU(), ...
github_jupyter
# Consulting Project ## Recommender Systems Your final result should be in the form of a function that can take in a Spark DataFrame of a single customer's ratings for various meals and output their top 3 suggested meals. For example: ``` import pandas as pd import matplotlib.pyplot as plt import seaborn as sns plt....
github_jupyter
``` data_paths = { 'Micro': "../data/runs/2018-11-10-micro-rad-khype1e6/", 'NNOrig': "../data/runs/2018-11-09-model188-equilibriation-penalty", 'NN': "../data/runs/2018-11-10-model188-khyp1e6-rerun/" } ng_path = "../data/processed/training.nc" from toolz import valmap from src.data.sam import SAMRu...
github_jupyter
# Deep Neural Network for Image Classification: Application When you finish this, you will have finished the last programming assignment of Week 4, and also the last programming assignment of this course! You will use the functions you'd implemented in the previous assignment to build a deep network, and apply it to...
github_jupyter
**This notebook is an exercise in the [Intermediate Machine Learning](https://www.kaggle.com/learn/intermediate-machine-learning) course. You can reference the tutorial at [this link](https://www.kaggle.com/alexisbcook/data-leakage).** --- Most people find target leakage very tricky until they've thought about it fo...
github_jupyter
# Signals and Sampling In this notebook, we will be exploring how signals look, how they are processed and sampled. We will be using the healthy cough sound to explore these properties of signals. This script is based on the Standford MIR project found [here](https://github.com/stevetjoa/stanford-mir). Use [librosa.l...
github_jupyter
# Setup --- ``` from graphqlclient import GraphQLClient import pandas as pd ENDPOINT = "https://api.thegraph.com/subgraphs/name/blocklytics/bancor" client = GraphQLClient(ENDPOINT) ``` # Fetch data --- ``` #ย Results must be paginated. #ย Subgraphs return a maximum of 100 rows. limit = 100 offset = 0 fetching_results ...
github_jupyter
# The TxTl Toolbox in BioCRNpyler ### A recreation of the original MATLAB TxTl Toolbox, as seen in [Singhal et al. 2020](https://www.biorxiv.org/content/10.1101/2020.08.05.237990v1) This tutorial shows how to use the EnergyTxTlExtract Mixture with a parameter file derived from the paper above. This Mixture is a simpl...
github_jupyter
Deep Learning ============= Assignment 1 ------------ The objective of this assignment is to learn about simple data curation practices, and familiarize you with some of the data we'll be reusing later. This notebook uses the [notMNIST](http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html) dataset to be used...
github_jupyter
# LAB 03: Basic Feature Engineering in Keras **Learning Objectives** 1. Create an input pipeline using tf.data 2. Engineer features to create categorical, crossed, and numerical feature columns ## Introduction In this lab, we utilize feature engineering to improve the prediction of housing prices using a Kera...
github_jupyter
``` # default_exp models.XCMPlus ``` # XCM (An Explainable Convolutional Neural Network for Multivariate Time Series Classification) > This is an unofficial PyTorch implementation by Ignacio Oguiza of - oguiza@gmail.com based on Temporal Convolutional Network (Bai, 2018). **References:** * Fauvel, K., Lin, T., Mas...
github_jupyter
## Intro to deep learning for medical imaging by [MD.ai](https://www.md.ai) ## Lesson 3. RSNA Pneumonia Detection Challenge (Kaggel API) The [Radiological Society of North America](http://www.rsna.org/) Pneumonia Detection Challenge: https://www.kaggle.com/c/rsna-pneumonia-detection-challenge This notebook covers th...
github_jupyter
## Linear least-squares and a bland dense network We're going to use the MIT-BIH datasets to train and test a basic feedforward network and see how it does. We'll compare the results to a linear regression. We'll use two different inputs: a mostly unprocessed version of the dataset, and a version in the frequency dom...
github_jupyter
### Data Visualization #### `matplotlib` - from the documentation: https://matplotlib.org/3.1.1/tutorials/introductory/pyplot.html `matplotlib.pyplot` is a collection of command style functions that make matplotlib work like MATLAB. <br> Each pyplot function makes some change to a figure: e.g., creates a figure, crea...
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="250 px" align="left"> ## _*E91 quantum key distribution protocol*_ *** ### Contributors Andrey Kardashin ## *Introduction* Suppose that Alice wants to send a mes...
github_jupyter
# 2A.eco - Python et la logique SQL - correction Correction d'exercices sur SQL. ``` from jyquickhelper import add_notebook_menu add_notebook_menu() ``` SQL permet de crรฉer des tables, de rechercher, d'ajouter, de modifier ou de supprimer des donnรฉes dans les bases de donnรฉes. Un peu ce que vous ferez bientรดt tous ...
github_jupyter
``` import numpy as np import pandas as pd import scipy import scipy.linalg import matplotlib.pyplot as plt import sklearn.metrics import sklearn.neighbors import time import os import torch from torch import nn import torch.nn.functional as F from torch.utils.data import DataLoader, Dataset, TensorDataset import ipd...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# OpenVINO benchmarking with 2D U-Net In this tutorial, we will use the Intelยฎ Distribution of OpenVINOโ„ข Toolkit to perform benchmarking This tutorial assumes that you have already downloaded and installed [Intel&reg; OpenVINO&trade;](https://software.intel.com/en-us/openvino-toolkit/choose-download) on your computer....
github_jupyter
# Convolutional Neural Networks: Step by Step Welcome to Course 4's first assignment! In this assignment, you will implement convolutional (CONV) and pooling (POOL) layers in numpy, including both forward propagation and (optionally) backward propagation. **Notation**: - Superscript $[l]$ denotes an object of the $l...
github_jupyter
<a href="https://colab.research.google.com/github/KordingLab/ENGR344/blob/master/tutorials/W4D1_How_do_we_know_how_certain_we_should_be/TA/W4D1_Tutorial4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 4: Model Selection: Bias-variance tr...
github_jupyter
# SageMaker endpoint To deploy the model you previously trained, you need to create a Sagemaker Endpoint. This is a hosted prediction service that you can use to perform inference. ## Finding the model This notebook uses a stored model if it exists. If you recently ran a training example that use the `%store%` magic...
github_jupyter
``` # Copyright 2021 NVIDIA Corporation. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
github_jupyter
# My Project In addition to being a place to experiment, this project has been structured to build and serve your model in a Flask application. The purpose is to allow data science exploration to easily transition into deployed services and applications on the OpenShift platform. After saving this project to git, it...
github_jupyter
``` import pandas as pd import matplotlib import matplotlib.pyplot as plt import seaborn as sns #Control figure import numpy as np import os from datetime import date matplotlib.style.use('ggplot') %matplotlib inline from sodapy import Socrata #MyAppToken = '' #client = Socrata("data.cityofnewyork.us", MyAppToken) #re...
github_jupyter
``` import glob import numpy as np from keras.layers import LSTM,Dense,Embedding,Dropout from keras.models import Sequential from keras.utils import np_utils from music21 import converter,instrument,note,chord from pickle import dump #used to save file def get_notes(): #function created to get notes from the fi...
github_jupyter
# JAX As Accelerated NumPy [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/jax/blob/main/docs/jax-101/01-jax-basics.ipynb) *Authors: Rosalia Schneider & Vladimir Mikulik* In this first section you will learn the very fundamentals of JAX. #...
github_jupyter
# 2.4 ใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใƒขใƒ‡ใƒซใฎๅฎŸ่ฃ…ใ€2.5 ้ †ไผๆฌ้–ขๆ•ฐใฎๅฎŸ่ฃ… ๆœฌใƒ•ใ‚กใ‚คใƒซใงใฏใ€SSDใฎใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใƒขใƒ‡ใƒซใจ้ †ไผๆฌforward้–ขๆ•ฐใ‚’ไฝœๆˆใ—ใพใ™ใ€‚ # 2.4 ๅญฆ็ฟ’็›ฎๆจ™ 1. SSDใฎใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใƒขใƒ‡ใƒซใ‚’ๆง‹็ฏ‰ใ—ใฆใ„ใ‚‹4ใคใฎใƒขใ‚ธใƒฅใƒผใƒซใ‚’ๆŠŠๆกใ™ใ‚‹ 2. SSDใฎใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใƒขใƒ‡ใƒซใ‚’ไฝœๆˆใงใใ‚‹ใ‚ˆใ†ใซใชใ‚‹ 3. SSDใงไฝฟ็”จใ™ใ‚‹ๆง˜ใ€…ใชๅคงใใ•ใฎใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใƒœใƒƒใ‚ฏใ‚นใฎๅฎŸ่ฃ…ๆ–นๆณ•ใ‚’็†่งฃใ™ใ‚‹ # 2.5 ๅญฆ็ฟ’็›ฎๆจ™ 1. Non-Maximum Suppressionใ‚’็†่งฃใ™ใ‚‹ 2. SSDใฎๆŽจ่ซ–ๆ™‚ใซไฝฟ็”จใ™ใ‚‹Detectใ‚ฏใƒฉใ‚นใฎ้ †ไผๆฌใ‚’็†่งฃใ™ใ‚‹ 3. SSDใฎ้ †ไผๆฌใ‚’ๅฎŸ่ฃ…ใงใใ‚‹ใ‚ˆใ†ใซใชใ‚‹ # ไบ‹ๅ‰ๆบ–ๅ‚™ ใจใใซใชใ— ``` # ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธ...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Pointwise-Local-Reconstruction-Error" data-toc-modified-id="Pointwise-Local-Reconstruction-Error-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Pointwise Local Reconstruction Error</a></span></li></ul></...
github_jupyter
``` %%init_spark launcher.jars = ["file:///opt/benchmark-tools/spark-sql-perf/target/scala-2.12/spark-sql-perf_2.12-0.5.1-SNAPSHOT.jar"] launcher.conf.set("spark.sql.warehouse.dir", "hdfs:///user/livy") !hadoop fs -mkdir /user/livy val scaleFactor = "1" // data scale 1GB val iterations = 1 // how...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Slice-specified-nodes-in-dimspec" data-toc-modified-id="Slice-specified-nodes-in-dimspec-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Slice specified nodes in dimspec</a></span></li><li><span><a href="...
github_jupyter
##### Copyright 2021 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
``` import warnings warnings.simplefilter('ignore', FutureWarning) import matplotlib matplotlib.rcParams['axes.grid'] = True # show gridlines by default %matplotlib inline import pandas as pd ``` ## Getting Comtrade data into your notebook In this exercise, you will practice loading data from Comtrade into a pandas...
github_jupyter
``` import requests import json url = "https://microsoft-computer-vision3.p.rapidapi.com/analyze" querystring = {"language":"en","descriptionExclude":"Celebrities","visualFeatures":"ImageType,Categories,Description","details":"Celebrities"} payload = "{\r\n \"url\": \"https://neilpatel.com/wp-content/uploads/2017/...
github_jupyter
``` import feather import os import re import pickle import time import datetime import numpy as np import pandas as pd from numba import jit from sklearn.metrics import roc_auc_score from sklearn.cross_validation import StratifiedKFold from sklearn.metrics import matthews_corrcoef import seaborn as sns import matp...
github_jupyter
# Can fingerprint distances discriminate DFG conformations? The `kissim` fingerprint encodes the pocket residues' spatial distance to four centers&mdash;the pocket centroid, hinge region, DFG region and front pocket&mdash;and should therefore discriminate between two structures in different conformations; when we comp...
github_jupyter
``` import datetime as dt import numpy as np import pandas as pd import panel as pn pn.extension('tabulator') ``` The ``Tabulator`` widget allows displaying and editing a pandas DataFrame. The `Tabulator` is a largely backward compatible replacement for the [`DataFrame`](./DataFrame.ipynb) widget and will eventually ...
github_jupyter
``` # Copyright 2022 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
# VGGNet in Keras In this notebook, we fit a model inspired by the "very deep" convolutional network [VGGNet](https://arxiv.org/pdf/1409.1556.pdf) to classify flowers into the 17 categories of the Oxford Flowers data set. Derived from [these](https://github.com/the-deep-learners/TensorFlow-LiveLessons/blob/master/note...
github_jupyter
# UAS Collected Traffic Data Analysis (UAS4T) The scope of the competition is to evaluate the accuracy of statistical or CI methods in transportation-related detection problems with specific reference in queue formation in urban arterials. The focus will be on obtaining results as close as possible to the real data. ...
github_jupyter
``` # Copyright 2021 Google LLC # Use of this source code is governed by an MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. # Notebook authors: Kevin P. Murphy (murphyk@gmail.com) # and Mahmoud Soliman (mjs@aucegypt.edu) # This notebook reproduces figures for chap...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Pretraining word and entity embeddings This notebook trains word embeddings and entity embeddings for DKN initializations. ``` from gensim.test.utils import common_texts, get_tmpfile from gensim.models import Wo...
github_jupyter
##Mounting Drive ``` from google.colab import drive drive.mount('/content/drive') ``` ## Installing and Importing required Libraries ``` !pip install -q transformers import numpy as np import pandas as pd from sklearn import metrics import transformers import torch from torch.utils.data import Dataset, DataLoader, R...
github_jupyter
# Kafka brokerใฎๆง‹็ฏ‰ๆ‰‹้ † ``` set -o pipefail ``` ## Ansibleใฎ่จญๅฎš ansibleใ‚’ใคใ‹ใฃใฆKafka brokerใ‚ฏใƒฉใ‚นใ‚ฟ(ใจzookeeperใ‚ฏใƒฉใ‚นใ‚ฟ)ใ‚’ๆง‹็ฏ‰ใ™ใ‚‹ใ€‚ ansibleใฎใ‚คใƒณใƒ™ใƒณใƒˆใƒชใƒ•ใ‚กใ‚คใƒซใ‚’ไฝœๆˆใ™ใ‚‹ใ€‚ ``` cat >inventory.yml <<EOF all: children: kafka: hosts: server1.example.jp: #ใ“ใ“ใซKafkaใ‚’ใ†ใ”ใ‹ใ™ใƒ›ใ‚นใƒˆใ‚’็พ…ๅˆ—ใ™ใ‚‹ใ€‚่กŒๆœซใฎใ‚ณใƒญใƒณใ‚’ๅฟ˜ใ‚Œใšใซ ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt dataset = pd.read_csv('../data/2016-11-22-reimbursements.xz', dtype={'document_id': np.str, 'congressperson_id': np.str, 'congressperson_document': np.str, ...
github_jupyter
``` # default_exp visrectrans ``` # VisRecTrans > A class for creating a custom [Vision Transformer (ViT)](https://arxiv.org/abs/2010.11929) model for visual recognition ``` #export #hide from nbdev.showdoc import * from fastai.vision.all import * import timm import math import warnings #export #hide class EmbedB...
github_jupyter
``` %matplotlib notebook import numpy as np import matplotlib.pyplot as plt import tessreduce as tr from scipy.optimize import minimize from scipy import signal from astropy.convolution import Gaussian2DKernel from scipy.optimize import minimize def Delta_basis(Size = 13): kernal = np.zeros((Size,Size)) x,y...
github_jupyter
``` from __future__ import print_function # !pip install tensorflow-gpu import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt %matplotlib inline from keras.models import Sequential from keras.layers import Dense , Dropout , Lambda,...
github_jupyter
# T5 for Cross-Language Plagiarism Detection Author: Joรฃo Phillipe Cardenuto In this notebook we implement a model regarding the Detailed Analysis of the CLPD. # Import Libraries ``` ! pip install -q pytorch-lightning ! pip install -q transformers # Mount drive from google.colab import drive drive.mount('/content/d...
github_jupyter
## Some Math Let's assume all objects are always centered at $x=0$ to simplify the FFT handling. We need a few relations to understand the math. 1. The Fourier transform of a function like $x^2W(x)$ is $F[x^2W(x)] \propto \frac{d^2\hat{W}(k)}{dk^2}$. 2. The Fourier transform of a Gaussian is a Gaussian, which we c...
github_jupyter
# Neural Networks ## 1. Neural Networks In this section, we will implement backpropagation algorithm to learn the parameters for the neural network. ### 1.1 Visualizing the data The data is the same as assignment 3, 5000 training examples, each contains a 20 pixel by 20 pixel grayscale image of the digit. ``` import...
github_jupyter
<a href="https://colab.research.google.com/github/SainiManisha/convnet-tutorial/blob/master/CNN_MNIST.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Convolutional Neural Networks ![cnn](https://miro.medium.com/max/2000/1*vkQ0hXDaQv57sALXAJquxA.jp...
github_jupyter
# Tensorflow training In this tutorial, you will train a mnist model in TensorFlow. ## Prerequisites * Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning (AML) * Go through the [configurat...
github_jupyter
``` import pandas as pd from pathlib import Path from sklearn.ensemble import GradientBoostingRegressor import matplotlib.pyplot as plt import seaborn as sns import numpy as np from sklearn.model_selection import learning_curve,RepeatedKFold from sklearn.pipeline import make_pipeline from yellowbrick.model_selection ...
github_jupyter
## Image Cleaner Widget fastai offers several widgets to support the workflow of a deep learning practitioner. The purpose of the widgets are to help you organize, clean, and prepare your data for your model. Widgets are separated by data type. ``` from fastai.vision import * from fastai.widgets import DatasetFormatt...
github_jupyter
# MaterialsCoord benchmarking โ€“ย symmetry of bonding algorithms Several near neighbor methods do not produce symmetrical bonding. For example, if site A is bonded to site B, it is not guaranteed that site B will be bonded to site A. In the MaterialsCoord benchmark we enforce symmetrical bonding for all algorithms. In t...
github_jupyter
# Python Data Analytics <img src="images/pandas_logo.png" alt="pandas" style="width: 400px;"/> Pandas is a numerical package used extensively in data science. You can call the install the ``pandas`` package by ``` pip install pandas ``` Like ``numpy``, the underlying routines are written in C with improved performa...
github_jupyter
# Effective Data Visualization ## PyCon 2020 ## Husni Almoubayyed [https://husni.space] ## Intro on packages: - **Matplotlib and Seaborn**: Main plotting package in python is called matplotlib. Matplotlib is the base for another package which builds on top of it called Seaborn. We will use Seaborn when possible as...
github_jupyter
# Mask R-CNN - Train on Shapes Dataset This notebook shows how to train Mask R-CNN on your own dataset. To keep things simple we use a synthetic dataset of shapes (squares, triangles, and circles) which enables fast training. You'd still need a GPU, though, because the network backbone is a Resnet101, which would be ...
github_jupyter
# CME 193: Introduction to Scientific Python ## Spring 2018 ## Lecture 1 # Lecture 1 Contents * Course Outline * Introduction * Python Basics * Installing Python --- # Quick Poll ## Who has written one line of code? ## ...a for loop? ## ...a function? ## Who has heard of recursion? ## ...object oriented prog...
github_jupyter
``` ! nvidia-smi ``` # Introduction This notebook holds the code for the [Involution](https://arxiv.org/abs/2103.06255) layer in tesorflow. The idea behind this layer is to invert the inherent properties of Convolution. Where convolution is spatial-agnostic and channel-specific, involution is spatial-specific and cha...
github_jupyter
# Section 4.3 : CYCLICAL MOMENTUM ## Summary - Learning rate and momentum are closely dependent, and both must be optimised - Momentum should be set as high as possible without causing instabilities in training - Momentum cannot be optimised in a similar way to LR, by using a momentum finder - Optimum settings found to...
github_jupyter
``` import torch from torch.autograd import Variable import torch.nn as nn import captcha_setting import operator import torchvision.transforms as transforms from PIL import Image import cv2 as cv import os from matplotlib import pyplot as plt import numpy as np import copy #for eachimg in filter_containor: class CNN(n...
github_jupyter
``` __author__ = 'Tilii: https://kaggle.com/tilii7' import warnings with warnings.catch_warnings(): warnings.filterwarnings('ignore') import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import matplotlib.cm as cm from sklearn.decomposition import PCA ...
github_jupyter
``` import torch import pandas as pd import matplotlib.pyplot as plt import os import subprocess import numpy as np os.chdir("/home/jok120/sml/proj/attention-is-all-you-need-pytorch/") basic_train_cmd = "/home/jok120/build/anaconda3/envs/pytorch_src2/bin/python " +\ "~/sml/proj/attention-is-all-you-ne...
github_jupyter
# <center>Value Function Approximation</center> ## <center>Part II</center> ## <center>Reference: Sutton and Barto, Chapter 9-11</center> ## <center>Table of Contents</center> <br> * **Batch Reinforcement Methods**<br><br> * **Least Squares Policy Iteration(LSPI)**<br><br> # <center>Batch Reinforcement Methods</cen...
github_jupyter
**This notebook is an exercise in the [Pandas](https://www.kaggle.com/learn/pandas) course. You can reference the tutorial at [this link](https://www.kaggle.com/residentmario/summary-functions-and-maps).** --- # Introduction Now you are ready to get a deeper understanding of your data. Run the following cell to lo...
github_jupyter
<h1><center>Report 12</center></h1> <h3><center>Jiachen Tian</center><h3> # Introduction This week's task is primarily glint detection. Right now there are three potential ways: KCF, Hough Transform, and Ratio Comparison. Even though Ratio Comparison works well under certain conditions within a certain displacement of...
github_jupyter
This demo provides examples of `ImageReader` class from `niftynet.io.image_reader` module. What is `ImageReader`? The main functionality of `ImageReader` is to search a set of folders, return a list of image files, and load the images into memory in an iterative manner. A `tf.data.Dataset` instance can be initialise...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#MSVO-3,-70" data-toc-modified-id="MSVO-3,-70-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>MSVO 3, 70</a></span></li><li><span><a href="#Text-Fabric" data-toc-modified-id="Text-...
github_jupyter
``` from resources.workspace import * %matplotlib inline ``` ## Dynamical systems are systems (sets of equations) whose variables evolve in time (the equations contains time derivatives). As a branch of mathematics, its theory is mainly concerned with understanding the behaviour of solutions (trajectories) of the syst...
github_jupyter
## 102 - Training Regression Algorithms with the L-BFGS Solver In this example, we run a linear regression on the *Flight Delay* dataset to predict the delay times. We demonstrate how to use the `TrainRegressor` and the `ComputePerInstanceStatistics` APIs. First, import the packages. ``` import numpy as np import p...
github_jupyter
# Object-Oriented Python During this session, we will be exploring the Oriented-Object paradigm in Python using all what we did with Pandas in previous sessions. We will be working with the same data of aircraft supervising latest Tour de France. ``` import pandas as pd df = pd.read_json("../data/tour_de_france.json...
github_jupyter
# SEC405: Scalable, Automated Anomaly Detection with Amazon GuardDuty and SageMaker ## Using IP Insights to score security findings ------- [Return to the workshop repository](https://github.com/aws-samples/aws-security-workshops/edit/master/detection-ml-wksp/) Amazon SageMaker IP Insights is an unsupervised anomaly ...
github_jupyter
**Source of the materials**: Biopython cookbook (adapted) <font color='red'>Status: Draft</font> Swiss-Prot and ExPASy {#chapter:swiss_prot} ===================== Parsing Swiss-Prot files ------------------------ Swiss-Prot (<http://www.expasy.org/sprot>) is a hand-curated database of protein sequences. Biopython ca...
github_jupyter
# Import packages and functions ``` import sys # force the notebook to look for files in the upper level directory sys.path.insert(1, '../') import pandas as pd from glob import glob import pymatgen as mg from data.compound_featurizer import read_new_struct, \ get_struct, get_elem_info, get_elem_distances, \ c...
github_jupyter