text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Mixture Density Networks Mixture density networks (MDN) (Bishop, 1994) are a class of models obtained by combining a conventional neural network with a mixture density model. ``` from __future__ import absolute_import from __future__ import division from __future__ import print_function import inferpy as inf impor...
github_jupyter
# Linear classifiers demo: `fit` CPSC 340: Machine Learning and Data Mining The University of British Columbia 2017 Winter Term 2 Mike Gelbart ``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline from plot_classifier import plot_loss_diagram, plot_classifier from sklearn.svm import SVC from s...
github_jupyter
<h1> Text Classification using TensorFlow/Keras on Cloud ML Engine </h1> This notebook illustrates: <ol> <li> Creating datasets for Machine Learning using BigQuery <li> Creating a text classification model using the Estimator API with a Keras model <li> Training on Cloud ML Engine <li> Deploying the model <li> Predict...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
## Practice Followings<br>์‹ค์Šต ์˜ˆ ### Opening a `bash` window on Linux GUI 1. Start a linux machine<br>๋ฆฌ๋ˆ…์Šค ์‹œ์ž‘ 1. Log in using your id<br>ํ•„์š”์‹œ id๋กœ log in 1. Press <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>t</kbd> key to open a `bash` terminal<br><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>t</kbd> ํ‚ค๋ฅผ ๋ˆŒ๋Ÿฌ `bash` ์ฐฝ์„ ์—ถ ### Opening a `git-b...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
*Lot of materials in today's workshop (including text, code, and figures) were adapted from the "SciPy 2017 Scikit-learn Tutorial" by Alexandre Gramfort and Andreas Mueller. The contents of their tutorial are licensed under Creative Commons CC0 1.0 Universal License as work dedicated to the public domain, and can be fo...
github_jupyter
# NHISS Categorization Analysis of 60 Experimentally Tested Molecules for Indocyanine Nanoparticle Formation Number of High Intrinsic State Substructures (NHISS) is calculated as the total number of functional groups in a molecule with fluorine (-F) and double bonded oxygen (=O). NHISS = fluorine + carbonyl + sulfiny...
github_jupyter
# ๆผ”็ฟ’5 - VQE(ๅค‰ๅˆ†้‡ๅญๅ›บๆœ‰ๅ€คใ‚ฝใƒซใƒใƒผ) *** ## ๆญดๅฒ็š„่ƒŒๆ™ฏ ้ŽๅŽป10ๅนด้–“ใงใ€้‡ๅญใ‚ณใƒณใƒ”ใƒฅใƒผใ‚ฟใƒผใฏๆ€ฅ้€Ÿใซๆˆ็†Ÿใ—ใ€้‡ๅญ็š„ใชๆ‰‹ๆณ•ใง่‡ช็„ถใฎๆณ•ๅ‰‡ใ‚’ใ‚ทใƒŸใƒฅใƒฌใƒผใƒˆใงใใ‚‹ใ‚ณใƒณใƒ”ใƒฅใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ทใ‚นใƒ†ใƒ ใจใ„ใ†ใƒ•ใ‚กใ‚คใƒณใƒžใƒณใฎๅคขใ‚’ๅฎŸ็พใ—ๅง‹ใ‚ใพใ—ใŸใ€‚2014ๅนดใฎ่ซ–ๆ–‡ใซใŠใ„ใฆใ€ๆœ€ๅˆใซใ€ใ‚ขใƒซใƒ™ใƒซใƒˆใƒปใƒšใƒซใƒƒใ‚พใŒ **ๅค‰ๅˆ†้‡ๅญๅ›บๆœ‰ๅ€คใ‚ฝใƒซใƒใƒผ(VQE)** ใ‚’็™บ่กจใ—ใพใ—ใŸใ€‚ๅˆ†ๅญใฎๅŸบๅบ•็Šถๆ…‹ใ‚จใƒใƒซใ‚ฎใƒผ(ๆœ€ๅฐใ‚จใƒใƒซใ‚ฎใƒผ)ใ‚’ใ“ใ‚Œใพใงใฎๆ‰‹ๆณ•ใ‚ˆใ‚Š็Ÿญใ„ๅ›ž่ทฏใง่ฆ‹ใคใ‘ใ‚‹ใ‚ขใƒซใ‚ดใƒชใ‚บใƒ ใงใ™ใ€‚[1]ใ€€ใใ—ใฆใ€2017ๅนดใซใ€IBMใฎ้‡ๅญใƒใƒผใƒ ใŒVQEใ‚ขใƒซใ‚ดใƒชใ‚บใƒ ใ‚’ไฝฟใฃใฆๆฐด็ด ๅŒ–ใƒชใƒใ‚ฆใƒ ๅˆ†ๅญใฎๅŸบๅบ•็Šถๆ…‹ใ‚’ใ‚ทใƒŸใƒฅใƒฌใƒผใƒˆใ—ใพใ—ใŸใ€‚[2] VQEใฎใƒžใ‚ธใƒƒใ‚ฏใฏใ€ๅ•้กŒใฎ่จˆ็ฎ—ใƒฏใƒผใ‚ฏใƒญใƒผใƒ‰ใฎ...
github_jupyter
# Benchmarking ## 0. Setup the logging This step sets up logging in our environment to increase our visibility over the steps that Draco performs. ``` import logging; logging.basicConfig(level=logging.INFO) logging.getLogger().setLevel(level=logging.ERROR) logging.getLogger('draco').setLevel(level=logging.INFO) im...
github_jupyter
![](assets/2_model_demo.gif) # Optimizing two models at once One might be interested in optimizing for two "compteting" models at the same time. Consider having 3 separate samples A, B, C and we'd be interesting in extracting the significance for two out of the three at the same time. Two models would be fitted, e.g ...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"). # Image Captioning with Attention <table class="tfo-notebook-buttons" align="left"><td> <a target="_blank" href="https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/...
github_jupyter
# Image processing for NGC 309: Part2 ``` import numpy as np import math from astropy.io import fits import os import sys import matplotlib.pyplot as plt import logging mpl_logger = logging.getLogger('matplotlib') mpl_logger.setLevel(logging.WARNING) global PIXEDFIT_HOME PIXEDFIT_HOME = os.environ['PIXEDFIT_HOME'] sy...
github_jupyter
``` def model_hyperparam_search(layers, activation_functions=['tanh', 'softmax', 'relu']): iterations = len(activation_functions)**layers af_combs = make_pairwise_list(max_depth=layers, options=activation_functions) print(f'{layers}\t{activation_functions}\t{iterations} iterations required') f...
github_jupyter
``` import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.keras.layers import Conv2D, Input, Flatten, Reshape from tensorflow.keras.layers import Dense, Conv2DTranspose, BatchNormalization, Activation from tensorflow.keras.models import Model from tensorflow.keras.datasets import ci...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt df1 = pd.read_csv("data_after_clustering.csv") df1.head() # ๆ•ฐๆฎไธญ็š„ๅˆ†็ฑป็ฑปๅž‹ๆ•ฐ้‡ df1["TRUE VALUE"].value_counts() # data1ๆ˜ฏๅŽปๆމ็œŸๅฎžๅˆ†็ฑปไฟกๆฏ็š„ๆ•ฐๆฎ้›†๏ผˆๅซๆœ‰่š็ฑปๅŽ็š„็ป“ๆžœ๏ผ‰ data1 = df1.drop("TRUE VALUE", axis=1) data1.head() df2 = pd.read_excel("data.xlsx", engine="openpyxl") df2.h...
github_jupyter
<img src="https://upload.wikimedia.org/wikipedia/commons/4/47/Logo_UTFSM.png" width="200" alt="utfsm-logo" align="left"/> # MAT281 ### Aplicaciones de la Matemรกtica en la Ingenierรญa ## Mรณdulo 02 ## Clase 01: Computaciรณn Cientรญfica ## Objetivos * Conocer las librerรญas de computaciรณn cientรญfica * Trabajar con arreglo...
github_jupyter
# Comparing the three algorithms by Neal ``` import numpy as np import scipy.stats as stats import subprocess import matplotlib.pyplot as plt from google.protobuf.internal.decoder import _DecodeVarint32 import sys sys.path.insert(0, '..') from proto.py.algorithm_state_pb2 import AlgorithmState import arviz as az # imp...
github_jupyter
#**Ctrl4AI** A helper package for Machine Learning and Deep Learning solutions **Developers:** Shaji, Charu, Selva ![AutoML](https://raw.githubusercontent.com/vkreat-tech/ctrl4ai/master/design/AutoML_Preprocess.png) **Highlights** - Open Source Package with emphasis on data preprocessing so far. - Self intelligent...
github_jupyter
# TensorFlow 2.0 ``` import os from glob import glob from datetime import datetime import numpy as np import tensorflow as tf from tensorflow.keras import layers from tensorflow.keras import datasets import matplotlib.pyplot as plt %load_ext tensorboard %matplotlib inline ``` ## Hyperparameter Tunning ``` num_...
github_jupyter
# Variational AutoEncoder **Author:** [fchollet](https://twitter.com/fchollet)<br> **Date created:** 2020/05/03<br> **Last modified:** 2020/05/03<br> **Description:** Convolutional Variational AutoEncoder (VAE) trained on MNIST digits. ## Setup ``` import numpy as np import tensorflow as tf from tensorflow import ke...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') ``` #**Part 1 - Data gathering and feature engineering** **Libraries** ``` import numpy as np #Linear_Algebra import matplotlib.pyplot as plt import pandas as pd #Data_Processing import pandas_datareader as pdr from scipy import stats %matplotlib inlin...
github_jupyter
# 1. Import libraries ``` #----------------------------Reproducible---------------------------------------------------------------------------------------- import numpy as np import tensorflow as tf import random as rn import os seed=0 os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) rn.seed(seed) #sess...
github_jupyter
## Interactive Computing in Jupyter and Python with OmniSci ![](https://avatars1.githubusercontent.com/u/7553829?s=200&v=4) ![](https://avatars1.githubusercontent.com/u/34879953?s=200&v=4) ### Bio Tony Fast is a Developer Advocate at Quansight with a passion for literate programing and a contributor to Jupyt...
github_jupyter
# DL Indaba Practical 2 # Feedforward Neural Networks on Real Data & Best Practices *Developed by Stephan Gouws, Avishkar Bhoopchand & Ulrich Paquet.* **Introduction** In this practical we will move on and discuss best practices for building and training models on real world data (the famous MNIST dataset of hand-wri...
github_jupyter
# Cartographic Visualization _โ€œThe making of maps is one of humanity's longest established intellectual endeavors and also one of its most complex, with scientific theory, graphical representation, geographical facts, and practical considerations blended together in an unending variety of ways.โ€_ &mdash; [H. J. Stewar...
github_jupyter
In this part of the tutorial, we run two ontology based methods to produce vector representations of biological entities: Onto2Vec and OPA2Vec. ## Onto2vec Onto2vec produces vectory representations based on the logical axioms of an ontology and the known associations between ontology classes and biological entities. ...
github_jupyter
## Copyright 2021 Antoine Simoulin. <i>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](https://www.apache.org/licenses/LICENSE-2.0) Unless required by ...
github_jupyter
# The Atoms of Computation Programming a quantum computer is now something that anyone can do in the comfort of their own home. But what to create? What is a quantum program anyway? In fact, what is a quantum computer? These questions can be answered by making comparisons to standard digital computers. Unfortuna...
github_jupyter
# Ensemble sorting of a Neuropixel recording (2) This notebook reproduces supplemental figure S2 from the paper [**SpikeInterface, a unified framework for spike sorting**](https://www.biorxiv.org/content/10.1101/796599v2). The recording was made by [Andrรฉ Marques-Smith](https://andremarques-smith.com/) in the lab of ...
github_jupyter
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/book1/supplements/autodiff_jax.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Automatic differentiation using JAX In this section, we illustrate automatic differentat...
github_jupyter
Este breve tutorial explica alguna de las herramientas bรกsicas de Ciencia de Datos disponibles en Python # ยฟQuรฉ es Python? - Python es un lenguaje de programaciรณn interpretado. - Su nombre proviene de la aficiรณn de su creador original, [Guido van Rossum](https://es.wikipedia.org/wiki/Guido_van_Rossum), por los humori...
github_jupyter
# Setting up + Problem Solving in Python ### [y3l2n](http://twitter.com/y3l2n) # Outline * Development environment * Writing/running code * Useful python modules for data anaylsis * Basic data analysis without any modules # Development Environment * Caveat: Linux/Mac OS X oriented * Distributions of python (python2 v...
github_jupyter
# Sparse Autoencoder ็•ถๅœจ่จ“็ทดไธ€ๅ€‹ๆ™ฎ้€š็š„ `autoenoder` ๆ™‚๏ผŒๅฆ‚ๆžœๅ˜—่ฉฆไธŸๅ…ฅไธ€ไบ›่ผธๅ…ฅ๏ผŒๆœƒ็œ‹ๅˆฐไธญ้–“่จฑๅคš็š„็ฅž็ถ“ๅ…ƒ (hidden unit) ๅคง้ƒจๅˆ†้ƒฝๆœƒๆœ‰ๆ‰€ๅๆ‡‰ (activate)๏ผŽๅๆ‡‰็š„ๆ„ๆ€ๆ˜ฏ้€™ๅ€‹็ฅž็ถ“ๅ…ƒ็š„่ผธๅ‡บไธๆœƒ็ญ‰ๆ–ผ้›ถ๏ผŒไนŸไธๆœƒๅพˆๆŽฅ่ฟ‘้›ถ๏ผŒ่€Œๆ˜ฏๅคงๆ–ผ้›ถ่จฑๅคš๏ผŽ็™ฝ่ฉฑ็š„ๆ„ๆ€ๅฐฑๆ˜ฏ็ฅž็ถ“ๅ…ƒ่ชช๏ผšใ€Œๅ’ฆ๏ผ้€™ๅ€‹่ผธๅ…ฅๆˆ‘่ช่ญ˜ๅ™ข๏ฝžใ€ ็„ถ่€Œๆˆ‘ๅ€‘ๆ˜ฏไธๆƒณ่ฆ็œ‹ๅˆฐ้€™ๆจฃ็š„ๆƒ…ๅฝข็š„๏ผๆˆ‘ๅ€‘ๆƒณ่ฆ็œ‹ๅˆฐ็š„ๆƒ…ๅฝขๆ˜ฏๆฏๅ€‹็ฅž็ถ“ๅ…ƒๅชๅฐไธ€ไบ›ไบ›่จ“็ทด่ผธๅ…ฅๆœ‰ๅๆ‡‰๏ผŽไพ‹ๅฆ‚ๆ‰‹ๅฏซๆ•ธๅญ— 0-9๏ผŒ้‚ฃ็ฅž็ถ“ๅ…ƒ A ๅชๅฐๆ•ธๅญ— 5 ๆœ‰ๅๆ‡‰๏ผŒ็ฅž็ถ“ๅ…ƒ B ๅชๅฐ 7 ๆœ‰ๅๆ‡‰ ... ็ญ‰๏ผŽ็‚บไป€้บผ่ฆ้€™ๆจฃ็š„็ตๆžœๅ‘ข๏ผŸๅœจ [Quora](https://www.quora.com/Why-are-sparse...
github_jupyter
##### Copyright 2020 Google LLC. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title License header # Copyright 2020 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 ...
github_jupyter
# Python graphics: Matplotlib fundamentals We illustrate three approaches to graphing data with Python's Matplotlib package: * [Approach 1](#Approach-1:--Apply-plot-methods-to-dataframes): Apply a `plot()` method to a dataframe * [Approach 2](#Approach-2:--plt.plot): Use the `plot(x,y)` function from `matplot...
github_jupyter
<div style="color:#303030;font-family:'arial blACK', sans-serif,monospace; text-align: center; padding: 50px 0; vertical-align:middle;" > <img src="https://github.com/PIA-Group/ScientIST-notebooks/blob/master/_Resources/Images/Lightbulb.png?raw=true" style=" background:linear-gradient(to right,#FDC86E,#fbb144);borde...
github_jupyter
# Week 2 ## Introduction to Solid State ``` import numpy as np import matplotlib.pyplot as plt import os import subprocess from polypy.read import History from polypy.msd import MSD from polypy import plotting def get_diffusion(file, atom): with open(file) as f: y = False for line in f: ...
github_jupyter
# Adversarial-Robustness-Toolbox for scikit-learn ExtraTreesClassifier ``` from sklearn.ensemble import ExtraTreesClassifier from sklearn.datasets import load_iris import numpy as np from matplotlib import pyplot as plt from art.estimators.classification import SklearnClassifier from art.attacks.evasion import ZooAt...
github_jupyter
CER010 - Install generated Root CA locally ========================================== This notebook will copy locally (from a Big Data Cluster) the generated Root CA certificate that was installed using either: - [CER001 - Generate a Root CA certificate](../cert-management/cer001-create-root-ca.ipynb) - [CER0...
github_jupyter
# AoC Day 3 Jenna Jordan 3 December 2021 ## Prompt --- Day 3: Binary Diagnostic --- The submarine has been making some odd creaking noises, so you ask it to produce a diagnostic report just in case. ### Part 1 The diagnostic report (your puzzle input) consists of a list of binary numbers which, when decoded prop...
github_jupyter
# Efficient RAW file generation by subsampling This tutorial discusses generating high resolution synthetic data with smaller volumes by using lower sample rates. If you have access to a GPU, it is highly recommended to install CuPy, which performs the equivalent NumPy array operations on the GPU (https://docs.cupy.de...
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
# Session 5: Generative Networks ## Assignment: Generative Adversarial Networks and Recurrent Neural Networks <p class="lead"> <a href="https://www.kadenze.com/courses/creative-applications-of-deep-learning-with-tensorflow/info">Creative Applications of Deep Learning with Google's Tensorflow</a><br /> <a href="http://...
github_jupyter
## Dependencies ``` import json, glob from tweet_utility_scripts import * from tweet_utility_preprocess_roberta_scripts_aux import * from transformers import TFRobertaModel, RobertaConfig from tokenizers import ByteLevelBPETokenizer from tensorflow.keras import layers from tensorflow.keras.models import Model ``` # L...
github_jupyter
``` %matplotlib inline import pandas as pd idx = pd.IndexSlice from IPython.core.display import HTML css = open('style-table.css').read() + open('style-notebook.css').read() HTML('<style>{}</style>'.format(css)) %%time cast = pd.DataFrame.from_csv('data/cast.csv', index_col=None) cast.head() %%time release_dates = pd.r...
github_jupyter
<a href="https://colab.research.google.com/github/THargreaves/beginners-python/blob/master/session_one/session_one_blank_template.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <center>Spotted a mistake? Report it <a href="https://github.com/THargr...
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
# Climate classification with neural networks The [Kรถppen Climate classification](https://en.wikipedia.org/wiki/Kรถppen_climate_classification) is a widely used climate classification system. It classifies locations around the world as climates like "Tropical rainforest" or "Warm summer continental". ![By Peel, M. C.,...
github_jupyter
# 2. Quickstart: Running a single Schwarzschild model By the end of the notebook, you will have run a Schwarzschild model. This will involve, 1. understanding the configuration file 2. executing commands to create and run a Schwarzschild model 3. plotting some output for this model ## Setup You should be in the dire...
github_jupyter
# Inverse problems ``` from IPython.core.display import HTML css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css' HTML(url=css_file) ``` So far we've looked at a variety of tests applied to *working, correct* code. All these tests have shown that the code is...
github_jupyter
## Simulating (pseudo-) random numbers in Python ### Setup ``` # numpy is the 'Numerical Python' package import numpy as np # Numpy's methods for pseudorandom number generation import numpy.random as rnd # scipy is the 'Scientific Python' package # We'll use this to get the gamma function from scipy.special import ...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix, classification_report from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score import itertools import glob import pickle import matplotlib....
github_jupyter
``` import pandas as pd import numpy as np from numpy.random import randint, choice, normal,shuffle from scipy.special import factorial from sklearn.model_selection import learning_curve, TimeSeriesSplit, PredefinedSplit from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error im...
github_jupyter
# EXAMPLE 1: Correct and display This example covers the basic usage of the dual-PRF velocity correction function: - [Load raw data with Py-ART](#load_data_pyart) - [Apply the correction function](#apply_vcor) - [Display the results](#display) **EVENT**: A tornado associated to a rotating cell that took place ne...
github_jupyter
# Round Trip Tear Sheet Example When evaluating the performance of an investing strategy, it is helpful to quantify the frequency, duration, and profitability of its independent bets, or "round trip" trades. A round trip trade is started when a new long or short position is opened and then later completely or partiall...
github_jupyter
# Collaborative filtering on the MovieLense Dataset ## Learning Objectives 1. Know how to explore the data using BigQuery 2. Know how to use the model to make recommendations for a user 3. Know how to use the model to recommend an item to a group of users ###### This notebook is based on part of Chapter 9 of [BigQuer...
github_jupyter
# Within Top 10% with Simple Regression Model. # Step By Step Procedure To Predict House Price # Importing packages We have **numpy** and **pandas** to work with numbers and data, and we have **seaborn** and **matplotlib** to visualize data. We would also like to filter out unnecessary warnings. **Scipy** for normali...
github_jupyter
``` import random import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import train_test_split from keras.layers import Embedding, Dense, Input, Flatten, Concatenate, Dropout from keras.models import Model, load_model, Sequential from keras.utils import to_categori...
github_jupyter
### 1. Import This Stuff ``` import gym import matplotlib.pyplot as plt %matplotlib inline import numpy as np def step(action, num_steps=1): e =env.unwrapped actions_meanings = e.get_action_meanings() # print(actions_meanings) act_dict = {actions_meanings[i].lower():i for i in range(len(actions_meanin...
github_jupyter
# NODDI-Watson *(Zhang et al. 2012)* proposed a model to estimate the dispersion of neurites (i.e. both axons and neuron dendrites), and is called Neurite Orientation Dispersion and Density Imaging (NODDI). It models dispersion for a single axon bundle using a Watson distribution $W(\kappa,\boldsymbol{\mu})$, that is ...
github_jupyter
``` %matplotlib inline ``` # Build a Neural Network Neural networks comprise of layers/modules that perform operations on data. The [torch.nn](https://pytorch.org/docs/stable/nn.html) namespace provides all the building blocks you need to build your own neural network. Every module in PyTorch subclasses the [nn.Mod...
github_jupyter
# AIT Development notebook ## notebook of structure |#|area name|cell num|description|edit or not| |---|---|---|---|---| | 1|flags set|1|setting of launch jupyter or ait flag.|no edit| | 2|ait-sdk install|1|Use only jupyter launch.<br>find ait-sdk and install.|no edit| | 3|create requirements and pip install|3|Use o...
github_jupyter
# Collision Avoidance - Train Model Welcome to this host side Jupyter Notebook! This should look familiar if you ran through the notebooks that run on the robot. In this notebook we'll train our image classifier to detect two classes ``free`` and ``blocked``, which we'll use for avoiding collisions. For this, we'll...
github_jupyter
### Import Libraries ``` import gym import utils import numpy as np import random from tqdm import tqdm import matplotlib.pyplot as plt %matplotlib inline ``` ### Create Bandit class as environment ``` # Here the default setting is to have 2 arms, # first one having a probability of winning 0.5 and reward 1, and # ...
github_jupyter
``` import sys import numpy as np import pandas as pd import itertools from collections import Counter import pysubgroup as ps sys.setrecursionlimit(3000) import pickle from SDDeclinations import * from SGDiscovery import * from SDPostprocessing import * from DynamicThreshold import * from scipy.stats import expon, gam...
github_jupyter
# Hands-on: Training and deploying Question Answering with BERT Pre-trained language representations have been shown to improve many downstream NLP tasks such as question answering, and natural language inference. Devlin, Jacob, et al proposed BERT [1] (Bidirectional Encoder Representations from Transformers), which f...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import mglearn from sklearn.linear_model import Ridge from sklearn.model_selection import train_test_split %matplotlib inline X, y = mglearn.datasets.load_extended_boston() X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mravanba/comp551-notebooks/blob/master/MLE.ipynb) # Maximum Likelihood ``` import numpy as np #%matplotlib notebook %matplotlib inline import matplotlib.pyplot as plt from IPython.core.debugger import...
github_jupyter
``` import pandas as pd import altair as alt import altair_latimes as lat alt.themes.register('latimes', lat.theme) alt.themes.enable('latimes') alt.data_transformers.enable('json') pitches = pd.read_csv("./input/curveballs.csv") pitches.info() pitches.release_speed.describe() pitches.release_spin_rate.describe() pitch...
github_jupyter
# Network Training Having implemented and tested all the components of the final networks in steps 1-3, we are now ready to train the network on a large dataset (ImageNet). ``` import gc import datetime import pandas as pd import numpy as np from copy import deepcopy from tqdm import tqdm from keras.preprocessing.i...
github_jupyter
## Dependencies ``` !pip install --quiet /kaggle/input/kerasapplications !pip install --quiet /kaggle/input/efficientnet-git import warnings, glob from tensorflow.keras import Sequential, Model import efficientnet.tfkeras as efn from cassava_scripts import * seed = 0 seed_everything(seed) warnings.filterwarnings('ig...
github_jupyter
# Creating a simple Auto-encoders from scratch with Fashion-MNIST dataset. ## 1) Import modules ``` %matplotlib inline %config InlineBackend.figure_format = 'retina' import matplotlib.pyplot as plt import pandas as pd import numpy as np import seaborn as sns import warnings warnings.filterwarnings('ignore') from t...
github_jupyter
``` import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np sns.axes_style("white") def show_lineplot(df, hue='model', x='iteration', y='item_rank', xlabel='Iteration', ylabel='Item Rank', name="item_rank_iteration", save=True): fig, ax = plt.subplots(figsize=(6, 3)) # df = ...
github_jupyter
<h1><center> INTRODUCTION TO PYTHON BASICS ``` # Taking input from the user num = int(input("Enter a number:")) print("The number entered by the user: ", num) type(num) a = 5 type(a) type(float(a)) b = 5.5 type(b) type(int(b)) ``` <h2> Arithmetic Operators ``` print(a+b) print(a-b) print(a*b) print(a/b) pri...
github_jupyter
# Load unique tweet tokens from file # Remove mentions and hashtags from tweets ### Save in another file the number of mentions for that tweet and the mentions list (same for hashtags) ``` import time from TokenizerWrapper import TokenizerWrapper from TokenizerWrapper import special_tokens import numpy as np ``` ##...
github_jupyter
# Tutorial Part 6: Introduction to Graph Convolutions In this tutorial we will learn more about "graph convolutions." These are one of the most powerful deep learning tools for working with molecular data. The reason for this is that molecules can be naturally viewed as graphs. ![Molecular Graph](https://github.com/d...
github_jupyter
<table align="left" width="100%"> <tr> <td style="background-color:#ffffff;"><a href="https://qsoftware.lu.lv/index.php/qworld/" target="_blank"><img src="..\images\qworld.jpg" width="35%" align="left"></a></td> <td align="right" style="background-color:#ffffff;vertical-align:bottom;horizontal-align:...
github_jupyter
# Contiguity diagram Computational notebook 06 for **Morphological tessellation as a way of partitioning space: Improving consistency in urban morphology at the plot scale**. Fleischmann, M., Feliciotti, A., Romice, O. and Porta, S. (2020) _โ€˜Morphological tessellation as a way of partitioning space: Improving consis...
github_jupyter
``` import pandas as pd, numpy as np, string, re, pytz import matplotlib.pyplot as plt, matplotlib.font_manager as fm from datetime import datetime as dt %matplotlib inline # define the fonts to use for plots family = 'DejaVu Sans' title_font = fm.FontProperties(family=family, style='normal', size=20, weight='normal', ...
github_jupyter
<a href="https://colab.research.google.com/github/Jaydenzk/DS-Unit-1-Sprint-3-Statistical-Tests-and-Experiments/blob/master/module3-introduction-to-bayesian-inference/LS_DS_133_Introduction_to_Bayesian_Inference.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Col...
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
<a href="https://colab.research.google.com/github/SiegfriedZhen/ptt-analysis/blob/master/ptt_etl_201910.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # ptt็š„็ถฒ่ทฏๅˆ†ๆž(network analysis) #### ่ฟ‘ๆœŸๅคฉไธ‹็š„ๅฐˆ้กŒ[่ผฟ่ซ–ๆˆฐ็ˆญ](https://www.cw.com.tw/article/article.action?id=5...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np ``` ## Aprendizaje de variedades Una de las debilidades del PCA es que no puede detectar caracterรญsticas no lineales. Un conjunto de algoritmos que evitan este problema son los algoritmos de aprendizaje de variedades (*manifold learning*). Un c...
github_jupyter
## __INTRODUCTION__ ### __ARTIFICIAL NEURAL NETWORKS__ * ML models that have a graph structure,inspired by the brain structure, with many interconnected units called artificial naurons https://www.youtube.com/watch?v=3JQ3hYko51Y * ANN have the ability to learn from raw data imputs, but it also makes them slower ...
github_jupyter
# Classification on Iris dataset with sklearn and DJL In this notebook, you will try to use a pre-trained sklearn model to run on DJL for a general classification task. The model was trained with [Iris flower dataset](https://en.wikipedia.org/wiki/Iris_flower_data_set). ## Background ### Iris Dataset The dataset c...
github_jupyter
# ๆœบๅ™จๅญฆไน ๅทฅ็จ‹ๅธˆ็บณ็ฑณๅญฆไฝ ## ๅผบๅŒ–ๅญฆไน  ## ้กน็›ฎ 4: ่ฎญ็ปƒๆ™บ่ƒฝๅ‡บ็งŸ่ฝฆๅญฆไผš้ฉพ้ฉถ ๆฌข่ฟŽๆฅๅˆฐๆœบๅ™จๅญฆไน ๅทฅ็จ‹ๅธˆ็บณ็ฑณๅญฆไฝ็š„็ฌฌๅ››ไธช้กน็›ฎ๏ผๅœจ่ฟ™ไธชnotebookๆ–‡ไปถไธญ๏ผŒๆจกๆฟไปฃ็ ๅทฒ็ปๆไพ›็ป™ไฝ ๏ผŒๆœ‰ๅŠฉไบŽไฝ ๅฏน*ๆ™บ่ƒฝๅ‡บ็งŸ่ฝฆ*็š„ๅˆ†ๆžๅ’Œๅฎž็Žฐๅญฆไน ็ฎ—ๆณ•ใ€‚ไฝ ๆ— ้กปๆ”นๅŠจๅทฒๅŒ…ๅซ็š„ไปฃ็ ๏ผŒ้™ค้žๅฆๆœ‰่ฆๆฑ‚ใ€‚ ไฝ ้œ€่ฆๅ›ž็ญ”notebookๆ–‡ไปถไธญ็ป™ๅ‡บ็š„ไธŽ้กน็›ฎๆˆ–ๅฏ่ง†ๅŒ–็›ธๅ…ณ็š„้—ฎ้ข˜ใ€‚ๆฏไธ€ไธชไฝ ่ฆๅ›ž็ญ”็š„้—ฎ้ข˜ๅ‰้ƒฝไผšๅ† ไปฅ**'้—ฎ้ข˜ X'**ใ€‚ไป”็ป†้˜…่ฏปๆฏไธช้—ฎ้ข˜๏ผŒๅนถๅœจๅŽ้ข**'ๅ›ž็ญ”'**ๆ–‡ๆœฌๆก†ๅ†…็ป™ๅ‡บๅฎŒๆ•ด็š„ๅ›ž็ญ”ใ€‚ไฝ ๆไบค็š„้กน็›ฎไผšๆ นๆฎไฝ ๅฏนไบŽๆฏไธช้—ฎ้ข˜็š„ๅ›ž็ญ”ไปฅๅŠๆไบค็š„`agent.py`็š„ๅฎž็Žฐๆฅ่ฟ›่กŒ่ฏ„ๅˆ†ใ€‚ >**ๆ็คบ๏ผš** Code ๅ’Œ Markdown ๅ•ๅ…ƒๆ ผๅฏ้€š่ฟ‡ **Shift + Enter*...
github_jupyter
# Tutorial 2. Solving a 1D diffusion equation ``` # Document Author: Dr. Vishal Sharma # Author email: sharma_vishal14@hotmail.com # License: MIT # This tutorial is applicable for NAnPack version 1.0.0-alpha4 ``` ### I. Background The objective of this tutorial is to present the step-by-step solution of a 1D diffus...
github_jupyter
# Overview - nb022ใฎๆ”น่‰ฏ - focal loss ใฎๆœ€้ฉๅŒ–ใ‚’่กŒใชใ† - nb019ใฎfolcal lossใ‚’ไฝฟใ† - top8ใ‚’้™คใ ``` # gitใฎhash import subprocess cmd = "git rev-parse --short HEAD" hash = subprocess.check_output(cmd.split()).strip().decode('utf-8') print(hash) ``` # Const ``` # basic NB = '023' DEBUG = False isPI = False isShowLog = False PATH_TRAIN...
github_jupyter
``` from datetime import date, timedelta import pandas as pd import numpy as np from sklearn.metrics import mean_squared_error import lightgbm as lgb cd E:\Time-Series Data df_train_train = pd.read_csv("train.csv", usecols=[1, 2, 3, 4, 5], dtype={'onpromotion': bool}, converters={'unit_sales': lambda u: np.log...
github_jupyter
# Working with raster data in python ## Table of Contents 1. [About the dataset](#dataset)<br> 2. [Part 1 - Weather maps with netCDF4 and matplotlib](#part1)<br> 2.1. [Import packages](#import1)<br> 2.2. [Load gridded data with netCDF4](#load1)<br> 2.3. [Create a global map of the average temperature in ...
github_jupyter
##### Copyright 2020 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 writing, softwar...
github_jupyter
# Data Processing with Python and Pandas Part One ## Today's Topics * What/Why Pandas * Data Structures * Loading Data * Basic Data Manipulation ## What is Pandas * Pandas is a 3rd-party library for doing data analysis * It is a foundational component of Python data science * Developed by [Wes McKinney](http://we...
github_jupyter
``` import numpy as np from itertools import permutations from collections import defaultdict import random ``` # load and parse dataset ``` !file umls -I raw_data = [] entities = set() with open('umls', 'r') as to_read: for i, line in enumerate(to_read.readlines()): s, p, o = line.strip().split(' ') ...
github_jupyter
``` # THIS CELL SETS STUFF UP FOR DEMO / COLLAB. THIS CELL CAN BE IGNORED. #-------------------------------------GET RID OF TF DEPRECATION WARNINGS--------------------------------------# import warnings warnings.filterwarnings('ignore', category=FutureWarning) import tensorflow as tf tf.compat.v1.logging.set_verbosit...
github_jupyter
``` import numpy as np import pandas as pd import sklearn import seaborn as sn import time import matplotlib.pyplot as plt from collections import defaultdict from collections import Counter from imblearn.under_sampling import RandomUnderSampler from sklearn.metrics import confusion_matrix,classification_report from sk...
github_jupyter
``` " Import the libraries " import os import sys import math import copy import numpy as np import pandas as pd from sklearn.neural_network import MLPClassifier from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler " Import the scripts of SD for Explaining and the supplementa...
github_jupyter
# Distributed Estimation This notebook goes through a couple of examples to show how to use `distributed_estimation`. We import the `DistributedModel` class and make the exog and endog generators. ``` import numpy as np from scipy.stats.distributions import norm from statsmodels.base.distributed_estimation import D...
github_jupyter
``` from setup import * import sys # if DATA_PATH not in sys.path: sys.path.append(DATA_PATH) %matplotlib inline display(HTML("<style>.container { width:100% !important; }</style>")) pd.set_option('display.max_rows', 4) pd.set_option('display.max_columns', 200) tfdf = pd.read_csv(os.path.join(DATA_PATH, 'tweet_vocab.cs...
github_jupyter
# MUTRAFF - Congestion Map Drawing Congestion tracing based on Mutraff Experiments over Google Maps References: * Mutraff * Jupyter gmaps: https://jupyter-gmaps.readthedocs.io/en/v0.3.3/gmaps.html * Blog examples: https://people.revoledu.com/kardi/tutorial/Python/Displaying+Locations+using+Heatmap.html ## Imports sect...
github_jupyter