text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Launch buttons for interactivity Because Jupyter Books are built with Jupyter Notebooks, you can allow users to launch live Jupyter sessions in the cloud directly from your book. This lets readers quickly interact with your content in a traditional coding interface using either JupyterHub or BinderHub. This page des...
github_jupyter
--- layout: page title: Método Científico (Incompleto) nav_order: 12 --- [<img src="./colab_favicon_small.png" style="float: right;">](https://colab.research.google.com/github/icd-ufmg/icd-ufmg.github.io/blob/master/_lessons/12-causalidade.ipynb) # Método Científico (Incompleto) {: .no_toc .mb-2 } Juntando o método...
github_jupyter
``` from transformers import GPT2Tokenizer, GPT2LMHeadModel, AutoTokenizer, AutoModelWithLMHead, BertTokenizer, LongformerTokenizer, LongformerModel import torch, json, random import numpy as np percentage = '20' path = '../data/multiwiz/agent/'+percentage+'p/' db_path = '../createData/multiwoz21/' artificial_data_path...
github_jupyter
# Prompt Tuning ``` import torch colab = 'google.colab' in str(get_ipython()) # You need a T4. A K80 will not work. if colab: !nvidia-smi gpu_type = torch.cuda.get_device_name(0) if gpu_type != 'Tesla T4': raise ValueError("I don't know about this, chief") # Setup for Colab only if colab: !pip...
github_jupyter
# Clickstream Analysis using Apache Spark and Apache Kafka(or Message hub). [Message Hub: Apache Kafka as a Service](https://developer.ibm.com/messaging/2016/03/14/message-hub-apache-kafka-as-a-service/), is well integrated into the IBM Data Science Experience. Before running the notebook, you will need to setup a [...
github_jupyter
# Welcome to hent-AI colab! This colab can utilize Googles vast resources for super fast decensoring using this project. All you need is a Google Drive and a good amount of free space on it. hent-AI git project page: https://github.com/natethegreate/hentAI # Prereqs In your Google Drive, make a folder called hent-AI...
github_jupyter
# About this kernel The `cost_function` in this kernel is roughly 300x faster compared to the original kernel. Each function call takes roughly 37 µs. ## Reference * (Excellent) Original Kernel: https://www.kaggle.com/inversion/santa-s-2019-starter-notebook * First kernel that had the idea to use Numba: https://www....
github_jupyter
# Part 3: Advanced Remote Execution Tools In the last section we trained a toy model using Federated Learning. We did this by calling .send() and .get() on our model, sending it to the location of training data, updating it, and then bringing it back. However, at the end of the example we realized that we needed to go...
github_jupyter
# Visual GPU Log Analytics Part I: CPU Baseline in Python Pandas Graphistry is great -- Graphistry and RAPIDS/BlazingDB is better! This tutorial series visually analyzes Zeek/Bro network connection logs using different compute engines: * Part I: [CPU Baseline in Python Pandas](./part_i_cpu_pandas.ipynb) * Part II: [...
github_jupyter
&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&ensp; [Home Page](Start_Here.ipynb) [Previous Notebook](Introduction_to_Performance_analysis.ipynb) &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp...
github_jupyter
``` %load_ext autoreload %autoreload 2 %matplotlib inline # Standard import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import signal from PIL import Image import scipy import os import cv2 # # Tensorflow and Keras # from keras.datasets import mnist # from keras.models...
github_jupyter
``` %matplotlib notebook import control as c import ipywidgets as w import numpy as np from IPython.display import display, HTML import matplotlib.pyplot as plt import matplotlib.animation as animation #display(HTML('<script> $(document).ready(function() { $(\"div.input\").hide(); }); </script>')) # Toggle cell visi...
github_jupyter
## Instructions 0. If you haven't already, follow [the setup instructions here](https://jennselby.github.io/MachineLearningCourseNotes/#setting-up-python3) to get all necessary software installed. 0. Install the Gensim word2vec Python implementation: `python3 -m pip install --upgrade gensim` 0. Get the trained model (1...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np ``` Training and Testing Data ===================================== To evaluate how well our supervised models generalize, we can split our data into a training and a test set: <img src="figures/train_test_split_matrix.svg" width="100%"> ``` ...
github_jupyter
# Mutivariate Regression Analysis *** **Videos can be found at: https://www.youtube.com/channel/UCBsTB02yO0QGwtlfiv5m25Q** In our previous tutorial, we explored the topic of Linear Regression Analysis which attempts to model the relationship between two variables by fitting a linear equation to the observed data. In ...
github_jupyter
# PINN: Heat equation with variable diffusion Solving the heat equation in 2D for variable diffusion D using the PINN-concept. ``` import torch import torchphysics as tp import math ``` First, we create the spaces for our problem. These define the variable names which will be used in the remaining part of this code. ...
github_jupyter
``` import numpy as np import torch import pandas as pd from transformers import PreTrainedTokenizerFast import re import spacy nlp = spacy.load("en_core_web_sm") tokenizer_bert = PreTrainedTokenizerFast.from_pretrained('bert-base-uncased', do_lower_case=True,return_offsets_mapping = True, max_length=512,truncate=True,...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # Two Formulations of Maxwell's equations in Cartesian Coor...
github_jupyter
``` import csv import pandas as pd import os import scipy.stats import numpy as np from datetime import date,timedelta,datetime def read_data(file): df = pd.read_csv(file) df = pd.DataFrame(df) return df def mofunc(row): if row['Severity'] > 0.8 or row['Hazard_Score'] > 80: return 'Warning' ...
github_jupyter
``` from google.colab import drive drive.mount('/content/gdrive') !pip install -q efficientnet import math, re, os import numpy as np import pandas as pd from matplotlib import pyplot as plt import tensorflow as tf import tensorflow_probability as tfp import tensorflow.keras.layers as L import tensorflow.keras.backend ...
github_jupyter
``` %cd .. import pandas as pd import pickle import numpy as np import matplotlib.pyplot as plt import sys sys.path.append(".") from src.factory import * from src.utils import * from sklearn.metrics import log_loss DATADIR = Path("../input/rsna-str-pulmonary-embolism-detection/") train = pd.read_csv(DATADIR / "train....
github_jupyter
``` import pandas as pd import numpy as np import json import matplotlib.pyplot as plt import matplotlib.ticker as ticker ``` # Coordinate Ascent - AUC only ``` coats_df_auc_only = pd.read_csv("../output_data/coordinate_ascent_run_AUConly.csv") coats_df_auc_only[coats_df_auc_only["loss"] == coats_df_auc_only["loss"]...
github_jupyter
``` import math import torch import matplotlib.pyplot as plt fpath = "./" range_ = 10.0 n_pts = 25 fname = "high_loss_" + str(range_) + "_" + str(n_pts) fname = fname.replace(".", "_") high_loss = torch.load(fpath + fname, map_location=("cpu")) fname = "low_loss_" + str(range_) + "_" + str(n_pts) fname = fname.replac...
github_jupyter
# Lightweight On-line Detector of Anomalies with MinMaxScaler This code template is for Anomaly detection/outlier analysis using the LODA Algorithm implemented using pyod library and feature scaling using MinMaxScaler. ### Required Packages ``` !pip install plotly !pip install pyod import time import warnings imp...
github_jupyter
``` import cv2 import PIL import kornia import glob import torch import numpy as np import imgaug as ia import imgaug.augmenters as iaa import matplotlib.pyplot as plt from torchvision import transforms as T from networks.ResnetFaceSTN import ResnetFaceSTN class RowImage: def __init__(self, resize_dim=None): ...
github_jupyter
[Table of Contents](./table_of_contents.ipynb) # Multivariate Gaussians Modeling Uncertainty in Multiple Dimensions ``` #format the book %matplotlib inline from __future__ import division, print_function from book_format import load_style load_style() ``` ## Introduction The techniques in the last chapter are very...
github_jupyter
$\newcommand{\vct}[1]{\boldsymbol{#1}} \newcommand{\mtx}[1]{\mathbf{#1}} \newcommand{\tr}{^\mathrm{T}} \newcommand{\reals}{\mathbb{R}} \newcommand{\lpa}{\left(} \newcommand{\rpa}{\right)} \newcommand{\lsb}{\left[} \newcommand{\rsb}{\right]} \newcommand{\lbr}{\left\lbrace} \newcommand{\rbr}{\right\rbrace} \newcommand{\f...
github_jupyter
``` # default_exp data.acquisition ``` # Data Acquisition > This is a script which invokes `pybaseball`'s [`statcast()`](https://github.com/jldbc/pybaseball#statcast-pull-advanced-metrics-from-major-league-baseballs-statcast-system) function to retrieve pitch-level data from statcast. ``` #hide # documentation from...
github_jupyter
``` #hide #default_exp vis.gen ``` # Visualisation Generation <br> ### Imports ``` #exports import json import pandas as pd import typer import croniter import importlib from tqdm import tqdm import matplotlib.pyplot as plt from IPython.display import JSON #exports def rgb_2_plt_tuple(r, g, b): """converts a ...
github_jupyter
SOP013 - Create secret for azdata login (inside cluster) ======================================================== Description ----------- Create a secret in the Kubernetes Secret Store, to: - Run app-deploys (i.e. `azdata app run`) - Save results in HDFS at /app-deploy - Enable SOP028 to perform `azdata login`...
github_jupyter
# Training a Score Estimator (SALLY) ``` import sys import os madminer_src_path = "/home/shomiller/madminer" sys.path.append(madminer_src_path) from __future__ import absolute_import, division, print_function, unicode_literals import logging import numpy as np import math import matplotlib from matplotlib import pyp...
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
# MLOps with Seldon and Jenkins Classic This repository shows how you can build a Jenkins Classic pipeline to enable Continuous Integration and Continuous Delivery (CI/CD) on your Machine Learning models leveraging Seldon for deployment. This CI/CD pipeline will allow you to: - Run unit tests using Jenkins Classic. -...
github_jupyter
El objetivo de este documento es explorar alternativas ofrecidas por la el modulo scipy.interpolate para interpolar datos 2d correspondientes a curvas de $C_L~vs.~\alpha$, $C_M~vs.~\alpha$ y $C_D~vs.~C_L$ para distintos reynolds. Los datos son estan extraidos del Report NACA 824 Gregory P.D. Siemens en 1994 cuando esta...
github_jupyter
# SETUP AND DEPS ``` ! git clone https://github.com/SwapnilDreams100/calling-out-bluff.git ! pip install alibi xhtml2pdf from google.colab import drive drive.mount('/content/drive') ! cp ./drive/My\ Drive/glove.6B.300d.txt ./ essay_type = '7' import keras.layers as klayers from keras.preprocessing.text import text_t...
github_jupyter
``` %load_ext sql %sql sqlite:// # Create tables & insert some random numbers # Note: in Postgresql, try the generate_series function... %sql DROP TABLE IF EXISTS R; DROP TABLE IF EXISTS S; DROP TABLE IF EXISTS T; %sql CREATE TABLE R (A int); CREATE TABLE S (A int); CREATE TABLE T (A int); for i in range(1,6): %sql...
github_jupyter
<a href="https://colab.research.google.com/github/DanIulian/BookStore/blob/master/02_rainbow(1)(1).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Not Quite Rainbow ``` # !apt install xvfb python-opengl ffmpeg -y > /dev/null 2>&1 # !pip install p...
github_jupyter
## Importing packages Throughout this tutorial, we will use the following common Python packages: ``` # Use these packages to easily access files on your hard drive import os, sys, glob # The Numpy package allows you to manipulate data (mainly numerical) import numpy as np # The Pandas package allows more advanced da...
github_jupyter
``` ### First imports and default parameters %matplotlib inline import warnings warnings.filterwarnings("ignore") import numpy as np import matplotlib import matplotlib.pyplot as plt # Overwritting matplotlib default linestyle of negative contours matplotlib.rcParams['contour.negative_linestyle'] = 'solid' SEED = ...
github_jupyter
In this notebook, we show how we can train a model with Scikit-learn and save it as a TileDB array on TileDB-Cloud. Firstly, let's import what we need. ``` import numpy as np import tiledb.cloud import os from sklearn import preprocessing from sklearn.linear_model import LogisticRegression from tiledb.ml.models.sklea...
github_jupyter
# Riskfolio-Lib Tutorial: <br>__[Financionerioncios](https://financioneroncios.wordpress.com)__ <br>__[Orenji](https://www.orenj-i.net)__ <br>__[Riskfolio-Lib](https://riskfolio-lib.readthedocs.io/en/latest/)__ <br>__[Dany Cajas](https://www.linkedin.com/in/dany-cajas/)__ <a href='https://ko-fi.com/B0B833SXD' target='...
github_jupyter
<a href="https://colab.research.google.com/github/neurorishika/PSST/blob/master/Tutorial/Day%203%20Cells%20in%20Silicon/Day%203.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> &nbsp; <a href="https://kaggle.com/kernels/welcome?src=https://raw.githubu...
github_jupyter
<a href="https://colab.research.google.com/github/nnuncert/nnuncert/blob/master/notebooks/DNNC_toy.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Git + Repo Installs ``` !git clone https://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@github.com/nnun...
github_jupyter
# Goals My goal with this dataset is it use a regression machine learning model to accurately predict the price of a house dependent on features. I will also look through some data analysis and a few other features such as PCA ## Process I’ll be following a typical data science pipeline, “OSEMN”. 1. Obtaining the da...
github_jupyter
# Hatch Template! ## Dandelion Voting Note: What are peoples goal target raise? 1. Percentage of total tokens that have to vote 'yes' to `something` for it to pass. ``` import param import panel as pn import pandas as pd import hvplot.pandas import holoviews as hv import numpy as np pn.extension() class DandelionVo...
github_jupyter
# Walkthrough: Multi Device Plugin and the DevCloud This notebook is a demonstration showing you how to request an edge node with an Intel i5 CPU and load a model on the CPU, GPU, and VPU (Intel® Neural Compute Stick 2) at the same time using the Multi Device Plugin on Udacity's workspace integration with Intel's DevC...
github_jupyter
``` import tensorflow as tf import cv2 import functools import json import math import matplotlib.pyplot as plt import numpy as np import os import random import time import xml.etree.ElementTree as ET import yaml from object_detection.utils import dataset_util from PIL import Image from PIL import ImageDraw from PIL...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W2D3_BiologicalNeuronModels/student/W2D3_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 1: The Leaky Integrate-and-Fire (L...
github_jupyter
``` from sympy import symbols, pprint from sympy import diff from sympy.solvers import solve import numpy as np from scipy import optimize import string import random from autodp.transformer_zoo import Composition from functools import lru_cache # data subject class Entity(): def __init__(self, name="", id=None): ...
github_jupyter
# Self-orginizing maps Self-orginizing map (SOM) is a type of neural network which is trained using unsupervised learning algorithms. One of the basic abilities of SOM is to project high-dimensional data to lower dimension (1D, 2D, 3D obviously). SOM can be considered as a general cluster analysis tool. Scheme of 2D ...
github_jupyter
<a href="https://colab.research.google.com/github/daveluo/covid19-healthsystemcapacity/blob/master/nbs/usa_beds_capacity_analysis_20200313_v2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !apt-get install python3-rtree !pip install geopandas i...
github_jupyter
``` #Load libraries import warnings warnings.filterwarnings("ignore") import numpy as np import pandas as pd from pandas import read_csv from pandas import set_option from matplotlib import pyplot from pandas import read_csv from pandas import set_option from matplotlib import pyplot as plt import seaborn HOME_PATH = '...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from urllib.request import Request, urlopen from IPython.display import Markdown as md %matplotlib inline ``` # Data explorations (c) Carlos Contreras, August 2021 ## Load data ``` df_comor = pd.read_csv('../../data/AH...
github_jupyter
<!-- # Copyright Amazon.com, Inc. or its affiliates. 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 # # ...
github_jupyter
An example showing univariate feature selection. Noisy (non informative) features are added to the iris data and univariate feature selection is applied. For each feature, we plot the p-values for the univariate feature selection and the corresponding weights of an SVM. We can see that univariate feature selection sel...
github_jupyter
# AWS Glue Notebook for Serverless Data Lake Workshop This notebook contains the PySpark scripts run in AWS Glue to transform the data in the data lake. Each section refers a section in the lab. ## Initialization The first two sections initialize the Spark environment and only need to be run once. The first block may...
github_jupyter
``` import os import sys import glob import torch import numpy as np import pydicom as dicom from skimage.draw import polygon import matplotlib.pyplot as plt %matplotlib inline def read_structure(structure): contours = [] for i, ri in enumerate(structure.ROIContourSequence): contour = {} #ret...
github_jupyter
# Interactive experimentation ``` !pip install --upgrade lightgbm scikit-learn pandas adlfs ``` ## Setup cloud tracking ``` import mlflow from azureml.core import Workspace ws = Workspace.from_config() mlflow.set_tracking_uri(ws.get_mlflow_tracking_uri()) mlflow.set_experiment("untitled") ``` ## Load data You can...
github_jupyter
# AttnGAN ## Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks http://openaccess.thecvf.com/content_cvpr_2018/papers/Xu_AttnGAN_Fine-Grained_Text_CVPR_2018_paper.pdf https://github.com/taoxugit/AttnGAN --- ## TODO - run le code en debug dans IntelliJ - indiquer les shapes dans...
github_jupyter
# Adversarial Attacks with parametrized DPR on VGGFace2 ``` from torch.autograd import Variable %load_ext autoreload %autoreload 2 import os.path import sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath('__file__')), '..')) from relighters.DPR.model.defineHourglass_512_gray_skip import HourglassNet ...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder from rules import normalized_chars import random import re from unidecode import unidecode laughing = { 'huhu', 'haha', 'gagaga', 'hihi', 'wkawka', 'wkwk', 'kiki', 'keke', 'huehue', 'hshs',...
github_jupyter
``` %matplotlib notebook import matplotlib.pyplot as plt import numpy as np import scipy.stats ``` # Tiempo de mezcla (mixing time) Previamente hemos visto como diseñar una cadena de Markov finita tal que converja a una distribución estacionaria de nuestro interés Pero ¿Cuánto debemos esperar para que ocurra la conv...
github_jupyter
``` import pandas as pd import os df = pd.read_table('linhas_dr.txt', delim_whitespace = True) df.head(5) columns = ["Hbeta", "OIII.4959", "OIII.5007", "NII.6548", "Halpha", "NII.6584", "SII.6716", "SII.6731", "mag_r"] for column in columns: if column == "Hbeta": df_final = df["Hbeta"] else: df_fin...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import sklearn as sk from sklearn.naive_bayes import MultinomialNB from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.metrics import f1_score from sklearn.preprocessing import M...
github_jupyter
<a href="https://colab.research.google.com/github/michelucci/zhaw-dlcourse-spring2019/blob/master/Week%203%20-%20Computational%20graphs/Week%203%20-%20Exercises%20Solutions.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neural Networks and Deep L...
github_jupyter
# Systematic correction of protein distribution moments (c) 2020 Manuel Razo. This work is licensed under a [Creative Commons Attribution License CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). All code contained herein is licensed under an [MIT license](https://opensource.org/licenses/MIT) --- ``` import ...
github_jupyter
# QuakeMigrate - Example - Icequake detection ## Overview: This notebook shows how to run QuakeMigrate for icequake detection, using a 2 minute window of continuous seismic data from Hudson et al (2019). Please refer to this paper for details and justification of the settings used. Here, we detail how to: 1. Create ...
github_jupyter
# Homework 1 *This notebook includes both coding and written questions. Please hand in this notebook file with all the outputs and your answers to the written questions.* This assignment covers linear filters, convolution and correlation ``` # Setup import numpy as np import matplotlib.pyplot as plt from time import ...
github_jupyter
## Stereo Vision ``` # import libraries import cv2 import numpy as np import matplotlib.pyplot as plt from numba import jit from math import sqrt # Read sample images left = cv2.imread('images/l4.png', 0) right = cv2.imread('images/r4.png', 0) plt.figure(figsize=(15,10)) ax1 = plt.subplot(121) ax1.imshow(left, cmap='...
github_jupyter
# Implementing an RNN in TensorFlow ---------------------------------- This script implements an RNN in TensorFlow to predict spam/ham from texts. We start by loading the necessary libraries and initializing a computation graph in TensorFlow. ``` import os import re import io import requests import numpy as np impor...
github_jupyter
# Classificador de Raças de Cachorros usando Tensorflow e Keras Neste notebook iremos implementadar um modelo para classificação de imagens. Classificação é uma das "tarefas" em que podemos utilizar Machine Learning, nesta tarefa o ensino é **supervisionado**, em outras palavras nós vamos ensinar ao modelo através de...
github_jupyter
<a href="https://colab.research.google.com/github/graviraja/100-Days-of-NLP/blob/applications%2Fgeneration/applications/generation/utterance_generation/Basic%20Utterance%20Generation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` TASK_DATA_DIR ...
github_jupyter
### BCO-DMO Knowledge Graph Data Exploration Prototype This is a prototype demonstrating how python can be used to interactively explore oceanographic data within the BCO-DMO Knowledge Graph. This demonstration was developed for SciPy 2020. **WARNING** This is just a prototype and will likely be updated (or abandoned...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # Initial Data for Solving Maxwell's Equations in Flat Spac...
github_jupyter
``` import pandas as pd import numpy as np import pandas as pd %matplotlib inline import numpy as np import matplotlib.pyplot as plt import math import seaborn as sns import matplotlib.colors as mcolors import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.formula.api import ols from sta...
github_jupyter
# Convolutional Neural Networks *by Marvin Bertin* <img src="../../images/keras-tensorflow-logo.jpg" width="400"> ## Convolutional Neural Networks (CNNs) Convolutional Neural Networks are very similar to ordinary (fully connected) Neural Networks. They are made up of neurons that have learnable weights and biases. E...
github_jupyter
# Recurrent Neural Networks When working with sequential data (time-series, sentences, etc.) the order of the inputs is crucial for the task at hand. Recurrent neural networks (RNNs) process sequential data by accounting for the current input and also what has been learned from previous inputs. In this notebook, we'll...
github_jupyter
# FormantNet Configuration Code This code is used to parse the configuration file, if one exists, and save the global variables used by FormantNet into one object, referred to as **cfg** in the other scripts and passed around from function to function. ``` import configparser class configuration(object): def __...
github_jupyter
``` ################################################################## #《Python机器学习及实践:从零开始通往Kaggle竞赛之路(2023年度版)》开源代码 #----------------------------------------------------------------- # @章节号:6.8.2.1(批量标准化的PyTorch实践) # @作者:范淼 ...
github_jupyter
``` import keras from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, CuDNNLSTM, CuDNNGRU, BatchNormalization, LocallyConnected2D, ...
github_jupyter
## Setup a classification experiment ``` import pandas as pd from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split df = pd.read_csv( "https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data", header=None) df.columns = [ "Age", "WorkClass", "fnlwgt...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Visualization/ndwi_symbology.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" ...
github_jupyter
``` import sys, glob, os SPARK_HOME=os.environ['SPARK_HOME'] sys.path.append(SPARK_HOME + "/python") sys.path.append(glob.glob(SPARK_HOME + "/python/lib/py4j*.zip")[0]) from pyspark import SparkConf from pyspark.sql import SparkSession from pyspark.sql.functions import * from pyspark.sql.window import Window, Window...
github_jupyter
# pinkfish-challenge Buy on the close on the SAME day a new 20 day high is set ``` # use future imports for python 3.x forward compatibility from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import # other imports import pand...
github_jupyter
# Tutorial This is a very basic tutorial of segmentation and reconstruction in SEM. Here, we use a simple 2-d embedding space as it is easy to visualize. For the purpose of this tutorial, we do not consider structured embedding space (the HRR). ``` # ## un-comment out if running locally # import os # os.chdir('../'...
github_jupyter
MNIST contains 70,000 images of handwritten digits: 60,000 for training and 10,000 for testing. The images are grayscale, 28x28 pixels. ``` import matplotlib.pyplot as plt %matplotlib inline import keras from keras.models import Sequential from keras.layers import Dense, Dropout import sys import tensorflow as tf impo...
github_jupyter
# 圖論(Graph Theory) ![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png) This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). _Tested on SageMath version 8.7_ ## 圖 一個__圖__ $G$ 由 一些**點** 還有一些__邊...
github_jupyter
# Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier. Have you ever wanted to make your text messages more expressive? Your emojifier app will help you do that. So rather than writing "Congratulations on the promotion! Lets get coffee and talk...
github_jupyter
# Машинное обучение, ФКН ВШЭ ## Практическое задание 2. KNN. Exploratory Data Analysis и линейная регрессия ### Оценивание и штрафы Каждая из задач имеет определенную «стоимость» (указана в скобках около задачи). Максимально допустимая оценка за работу — 10 баллов. Проверяющий имеет право снизить оценку за неэффектив...
github_jupyter
# Variational Auto Encoders using Ignite This is a tutorial on using Ignite to train neural network models, setup experiments and validate models. In this experiment, we'll be replicating [Auto-Encoding Variational Bayes](https://arxiv.org/abs/1312.6114) by Kingma and Welling. This paper uses an encoder-decoder archi...
github_jupyter
# Analysis of single-cell transcriptomics This tutorial demonstrates how to analyze single-cell transcriptomics data using LANTSA including * Clustering & visualization * Cell type marker genes ``` import numpy as np import pandas as pd import scanpy as sc import matplotlib.pyplot as plt import lantsa ``` ## Read t...
github_jupyter
``` import numpy as np from mlp.layers import BatchNormalizationLayer test_inputs = np.array([[-1.38066782, -0.94725498, -3.05585424, 2.28644454, 0.85520889, 0.10575624, 0.23618609, 0.84723205, 1.06569909, -2.21704034], [ 0.11060968, -0.0747448 , 0.56809029, 2.45926149, -2.28677816, -0.99...
github_jupyter
# Задание 2.2 - Введение в PyTorch Для этого задания потребуется установить версию PyTorch 1.0 https://pytorch.org/get-started/locally/ В этом задании мы познакомимся с основными компонентами PyTorch и натренируем несколько небольших моделей.<br> GPU нам пока не понадобится. Основные ссылки: https://pytorch.org/t...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys from pathlib import Path sys.path.append(str(Path('.').resolve().parents[0])) from pprint import pprint from collections import Counter import numpy as np import pandas as pd import sklearn from imblearn.under_sampling import RandomUnderSampler, NearMiss, EditedNearest...
github_jupyter
# Test notebook Meteorites ``` from pathlib import Path import numpy as np import pandas as pd import requests from IPython.display import display from IPython.utils.capture import capture_output import pandas_profiling from pandas_profiling.utils.cache import cache_file file_name = cache_file( "meteorites.csv",...
github_jupyter
#### MicroSoft MSVC cl ``` //--------------------------- //%runinterm //%term:c:\Windows\System32\cmd.exe /c start //%execfile:src\test.exe //--------------------------- //%ccompiler:cl //%cflags: /Fe:src\test.exe /source-charset:utf-8 //%ldflags:/execution-charset:utf-8 //--------------------------- //%overwritefile ...
github_jupyter
# Section 4: Case Study I - U-Net for Building Mapping Now let's move in to a little advance model call U-Net. U-Net is popular in satellite image analysis (remote sensing) community. It’s very elegant and simple model that can be used to perform semantic segmentation task (labelling each pixel) well. In this section...
github_jupyter
# バッチ推論サービスを作成する 健康クリニックは一日中患者の測定を取り、各患者の詳細を別々のファイルに保存すると想像してください。その後、一晩で糖尿病予測モデルを使用して、その日のすべての患者データをバッチとして処理し、翌朝待つ予測を生成し、糖尿病のリスクがあると予測される患者をフォローアップできるようにします。Azure Machine Learning では、*バッチ推論パイプライン*を作成することでこれを実現できます。そして、この演習ではそれを実施します。 ## ワークスペースに接続する 作業を開始するには、ワークスペースに接続します。 > **注**: Azure サブスクリプションでまだ認証済みのセッ...
github_jupyter
#$EXERCISE_PREAMBLE$ As before, don't forget to run the setup code below before jumping into question 1. ``` # SETUP. You don't need to worry for now about what this code does or how it works. from learntools.core import binder; binder.bind(globals()) from learntools.python.ex2 import * print('Setup complete.') ``` ...
github_jupyter
Sascha Spors, Professorship Signal Theory and Digital Signal Processing, Institute of Communications Engineering (INT), Faculty of Computer Science and Electrical Engineering (IEF), University of Rostock, Germany # Data Driven Audio Signal Processing - A Tutorial with Computational Examples Winter Semester 2021/22 (M...
github_jupyter