text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Manage the EISCAT data ## Download and load eiscat data EISCAT provides three kinds of data file formats. They are **mat**, **eiscat-hdf5**, and **madrigal-hdf5**. Currently, [GeospaceLab](https://github.com/JouleCai/geospacelab) supports the **eiscat-hdf5** and **madrigal-hdf5** files. The package can download a...
github_jupyter
``` import os import pickle import numpy as np import matplotlib.pyplot as plt %matplotlib inline %load_ext autoreload %autoreload 2 np.set_printoptions(precision=2) import normal_pkg.normal as nor import normal_pkg.adaptation as ada from normal_pkg.adaptation import CholeskyModule ``` # Fix the convergence of Proxim...
github_jupyter
# Introdução ao Python - Ana Beatriz Macedo<img src="https://octocat-generator-assets.githubusercontent.com/my-octocat-1626096942740.png" width="324" height="324" align="right"> ## Link para download: https://github.com/AnabeatrizMacedo241/Python-101 ## Github: https://github.com/AnabeatrizMacedo241 ## Linkedin: www.li...
github_jupyter
# Formal Simulated Inference 1. Define F (i.e. your model and assumptions) 2. Formalize test 3. Describe test statistic 4. A. Sample data from F∈ℱ0 B. Sample data from F∈ℱA 5. A. Plot power vs n (i.e. perspective power analysis) B. Plot power vs n (i.e. perspective power analysis) 6. Apply to data ## Step 1: Def...
github_jupyter
<center> <table style="border:none"> <tr style="border:none"> <th style="border:none"> <a href='https://colab.research.google.com/github/AmirMardan/ml_course/blob/main/3_pandas/0_intro_to_pandas.ipynb'><img src='https://colab.research.google.com/assets/colab-badge.svg'></a> </th> <th style="bor...
github_jupyter
##### Copyright 2019 The TensorFlow Hub Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` # Copyright 2019 The TensorFlow Hub Authors. 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. ...
github_jupyter
## Task #2 In the following task, we will train a Restricted Boltzmann Machine (RBM) on 100 Rydberg atoms data. We will compare the energy of our simulated system against the exact known energy. In order to do this, it is necessary to explore some parameters of the Boltzman network. The number of hidden nodes and samp...
github_jupyter
# ModelList (Multi-Output) GP Regression ## Introduction This notebook demonstrates how to wrap independent GP models into a convenient Multi-Output GP model using a ModelList. Unlike in the Multitask case, this do not model correlations between outcomes, but treats outcomes independently. This is equivalent to set...
github_jupyter
``` #hide from utils import * ``` # Collaborative Filtering Deep Dive ## A First Look at the Data ``` from fastai.collab import * from fastai.tabular.all import * path = untar_data(URLs.ML_100k) ratings = pd.read_csv(path/'u.data', delimiter='\t', header=None, names=['user','movie','rating','ti...
github_jupyter
# Fashion MNIST -[Rishit Dagli](rishit.tech) ## About Me [Twitter](https://twitter.com/rishit_dagli) [GitHub](https://github.com/Rishit-dagli) [Medium](https://medium.com/@rishit.dagli) Note: Please unzip the files with the code in the cell below before you move forward ``` # !unzip /Fashion MNIST/fashionmnist.zi...
github_jupyter
``` %matplotlib inline %pdb on from pprint import pprint import itertools import numpy from metrics import wer, cew, ssr, average, hreff import montecarlo import market import dms import withdrawal import mortality from portfolio import Portfolio import harvesting from decimal import Decimal as D import plot from ma...
github_jupyter
# M-Estimators for Robust Linear Modeling ``` %matplotlib inline from __future__ import print_function from statsmodels.compat import lmap import numpy as np from scipy import stats import matplotlib.pyplot as plt import statsmodels.api as sm ``` * An M-estimator minimizes the function $$Q(e_i, \rho) = \sum_i~\rh...
github_jupyter
# Doubly Robust Models Basically, different ensemble models that utilize a weight model to augment the outcome model. This notebook presents different combinations of mixing outcome and propensity models, but since the possible combination are a lot, it does not intend to show all of them. ``` %matplotlib inline ...
github_jupyter
``` #import necessary libraries import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder %matplotlib inline ``` ### Business Understanding As a soccer lover, I'm fascinated to explore o...
github_jupyter
``` !pip install semantic-text-similarity from semantic_text_similarity.models import WebBertSimilarity from semantic_text_similarity.models import ClinicalBertSimilarity web_model = WebBertSimilarity(device='cpu', batch_size=10) #defaults to GPU prediction # clinical_model = ClinicalBertSimilarity(device='cuda', bat...
github_jupyter
``` import pandas as pd import numpy as np import os,glob from matplotlib import pyplot as plt def modify_topics(t): ''' Create a field/column with a list of the topics for that talk Modify the topics csv so that the title of the Talk will be split into the appropriate dates create a one hot ...
github_jupyter
#RepresentationSpace - Discovering Interpretable GAN Controls for Architectural Image Synthesis Using [Ganspace]( https://github.com/armaank/archlectures/ganspace) to find latent directions in a StyleGAN2 model trained trained on the [ArchML dataset](http://165.227.182.79/) ## Instructions and Setup 1) Click the pla...
github_jupyter
<table class="tfo-notebook-buttons" align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/PreferredAI/tutorials/blob/master/recommender-systems/08_retrieval.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" />Run in Google Colab</a> </td> <td> <a target...
github_jupyter
``` %load_ext autoreload %autoreload 2 import urban_dictionary_scraper import logging import pickle from scipy import stats import pandas as pd import stanza from tqdm.notebook import tqdm from collections import OrderedDict from functools import partial from concurrent.futures import ThreadPoolExecutor from multiproce...
github_jupyter
# Representing Qubit States You now know something about bits, and about how our familiar digital computers work. All the complex variables, objects and data structures used in modern software are basically all just big piles of bits. Those of us who work on quantum computing call these *classical variables.* The comp...
github_jupyter
# Ensemble ``` import numpy as np import math import torch import import_ipynb from . import dist class Ensemble: def __init__( self, nets: list, mode: callable = None, reputations=None ): """Create an ensemble model and its methods. Parameters -------...
github_jupyter
# Working with NetCDF files One of the most common file formats within environmental science is NetCDF ([Network Common Data Form](https://www.unidata.ucar.edu/software/netcdf/)). This format allows for storage of multiple variables, over multiple dimensions (i.e. N-dimensional arrays). Files also contain the ass...
github_jupyter
### Setup ``` %load_ext autoreload %autoreload 2 # Set file paths import os import os.path as op from pathlib import Path import Buzznauts as buzz buzz_root = Path(buzz.__path__[0]).parent.absolute() # Data paths fmri_dir = op.join(buzz_root, "data", "fmri") stimuli = op.join(buzz_root, "data", "stimuli") videos_dir...
github_jupyter
``` import numpy as np import pandas as pd from pandas import Series, DataFrame from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn import metrics import matplotlib.pyplot as plt from matplotlib import style import seaborn as sns import csv df_user = pd....
github_jupyter
# Computer vision data ``` %matplotlib inline from fastai.gen_doc.nbdoc import * from fastai import * from fastai.vision import * ``` This module contains the classes that define datasets handling [`Image`](/vision.image.html#Image) objects and their tranformations. As usual, we'll start with a quick overview, befor...
github_jupyter
# ClusterAI 2020 # Ciencia de Datos - Ingenieria Industrial UTN BA # Curso I5521 # Clase 01: analisis exploratorio de datos con datos de Google Play #### Elaborado por: Nicolás Aguirre ``` from google.colab import drive drive.mount('/gdrive') DRIVE_FOLDER = 'ClusterAI2020/' CLASS_FOLDER = 'clase_01/' DATA_PATH = "../d...
github_jupyter
<img src="images/dask_horizontal.svg" width="45%" alt="Dask logo\"> # Scaling your data work with Dask ## PyData Global 2020 ### Materials & setup - Tutorial materials available at https://github.com/coiled/pydata-global-dask - Two ways to go through the tutorial: 1. Run locally on your laptop ...
github_jupyter
# Plotting programs This notebook illustrates a secondary feature of the plotting library - plotting program related quantities such as - Program spending - Coverage The functionality is build on the standard plotting library - as described in the plotting documentation, the general workflow is to 1. Create a `Plo...
github_jupyter
# Random Forests ``` !pip install scikit-learn==0.23.2 import pandas as pd import numpy as np from sklearn.datasets import load_digits import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, plot_confusion_matrix from sklearn.ensemble import Rand...
github_jupyter
# Deep Learning & Art: Neural Style Transfer In this assignment, you will learn about Neural Style Transfer. This algorithm was created by [Gatys et al. (2015)](https://arxiv.org/abs/1508.06576). Download the data in [coursera-deep-learning-specialization](https://github.com/amanchadha/coursera-deep-learning-specializ...
github_jupyter
# DataFrames DataFrames are the workhorse of pandas and are directly inspired by the R programming language. 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 ...
github_jupyter
<h1><center>Предобработка текста</center></h1> ## Основные техники * Уровень символов: * Токенизация: разбиение текста на слова * Разбиение текста на предложения * Уровень слов – морфология: * Разметка частей речи * Снятие морфологической неоднозначности * Нормализация (стемминг или лемматизация) ...
github_jupyter
In his blog post [Embedding Matplotlib Animations in IPython Notebooks](http://jakevdp.github.io/blog/2013/05/12/embedding-matplotlib-animations/), Jake VanderPlas presents a slick hack for embedding Matplotlib Animations in IPython Notebooks, which involves writing it as a video to a [tempfile](https://docs.python.org...
github_jupyter
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/> # CCXT - Calculate Support and Resistance <a href="https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/CCXT/CCXT_Calculate_Support_and_Resistance...
github_jupyter
``` %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import re sns.set() pd.set_option('max_columns', 999) df = pd.read_csv('/Users/daviderickson/projects/datasf/data/Assessor_Historical_Secured_Property_Tax_Rolls.csv') df_flw = df[df['Property Location'].s...
github_jupyter
# Explain binary classification model predictions on GPU _**This notebook showcases how to use the interpret-community repo to help interpret and visualize predictions from a binary classification model on GPU.**_ Adapted from `explain-binary-classification-local.ipynb` notebook in the repository ## Table of Contents...
github_jupyter
# Active Inference: Simple Generative Model This notebook simulates an active inference agent behaving in a random environment described by a single hidden state variable and a single observation modality. The agent uses variational inference to infer the most likely hidden states, and optimizes its policies with respe...
github_jupyter
<a href="https://colab.research.google.com/github/adasegroup/ML2021_seminars/blob/master/seminar3/seminar03-solution.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Measure quality of a classification model This notebook explains how to measure q...
github_jupyter
## R SWAT Modelagen Github do SWAT: https://github.com/sassoftware/R-swat Action sets: https://go.documentation.sas.com/?docsetId=allprodsactions&docsetTarget=actionSetsByName.htm&docsetVersion=3.5&locale=en Documentacion: https://developer.sas.com/apis/swat/r/v1.3.0/R-swat.pdf ``` #install.packages('https://github...
github_jupyter
## Predicting synthesizability of arbitrary crystal structures and compositions This notebook shows how to: * Access material structures from the Materials Project (MP) using the Materials API (MAPI) or figshare. * Use pre-trained models to predict synthesizability of materials from either 1) Materials Project ID; 2)...
github_jupyter
# TextBlob TextBlob is a Python (2 and 3) library for processing textual data. It provides a simple API for diving into common Natural Language Processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis, classification, translation, and more. ### Import TextBlob ``` from text...
github_jupyter
# Part 3: Create a model to serve the item embedding data This notebook is the third of five notebooks that guide you through running the [Real-time Item-to-item Recommendation with BigQuery ML Matrix Factorization and ScaNN](https://github.com/GoogleCloudPlatform/analytics-componentized-patterns/tree/master/retail/re...
github_jupyter
``` import pandas as pd import sys import os import holoviews as hv from IPython.core.display import display, HTML from holoviews import opts, dim, Palette ################################ CONFIGURATION FILE HANDLING ################################# import configparser config = configparser.ConfigParser() try: ...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Estimating Baseline Performance <br> Estimating baseline performance is as important as choosing right metrics for model evaluation. In this notebook, we briefly discuss about why do we care about baseline perfor...
github_jupyter
SOP062 - Install ipython-sql and pyodbc modules =============================================== Steps ----- ### Common functions Define helper functions used in this notebook. ``` # Define `run` function for transient fault handling, hyperlinked suggestions, and scrolling updates on Windows import sys import os imp...
github_jupyter
``` from __future__ import print_function import sisl import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` First TranSiesta bias example. In this example we will take the system from [TS 1](../TS_01/run.ipynb) and perform bias calculations on it. Note, however, that applying a bias to a *pristine...
github_jupyter
``` import pandas as pd import numpy as np # Read in feature sets and corresponding outputs X = pd.read_csv("all_features_QF_SLIA.csv") y = pd.read_csv("times_QF_SLIA_ALL.csv") from scipy.stats import zscore # Normalize features to zero mean and unit variance X = X.apply(zscore) # Convert output values to 0 for 30-60s...
github_jupyter
**Authors:** Peter Štrauch, Jozef Hanč, Martina Hančová <br> **R consultant:** Andrej Gajdoš <br> [Faculty of Science](https://www.upjs.sk/en/faculty-of-science/?prefferedLang=EN) *P. J. Šafárik University in Košice, Slovakia* <br> email: [jozef.hanc@upjs.sk](mailto:jozef.hanc@upjs.sk) *** **<font size=6 color=brow...
github_jupyter
# Rotor Estimation using the Tensor Representation of Geometric Algebra ``` from __future__ import print_function import sys sys.path.append('../build/') %pylab inline np.set_printoptions(precision=2, suppress=True,threshold=np.inf) import versor as vsr ``` ## Dataset generation ``` r = vsr.Rot(vsr.Biv(0,1,0) * np.p...
github_jupyter
# Quick demonstration of R-notebooks using the r-oce library Created: 2017-01-23 The IOOS notebook [environment](https://github.com/ioos/notebooks_demos/blob/229dabe0e7dd207814b9cfb96e024d3138f19abf/environment.yml#L73-L76) installs the `R` language and the `Jupyter` kernel needed to run `R` notebooks. Conda can also...
github_jupyter
## Script to load financial time-series (per-minute ETFs) data from CSV files into a Pandas DF and a Postgres table ### The ingestion for Pandas is also done in its own perf tests notebook ``` data_path = '/workspace/data/datasets/unianalytica/group/analytics-perf-tests/symbols/' import sys import os import csv import...
github_jupyter
``` import arviz as az import xarray as xr from generate_data import generate_data from utils import StanModel_cache n = 70 Years_indiv, Mean_RT_comp_Indiv, Mean_RT_incomp_Indiv = generate_data(8, n) dims = {"y_obs_comp": ["subject"], "y_obs_incomp": ["subject"]} log_lik_dict = {"y_obs_comp": "log_lik_comp", "y_obs_in...
github_jupyter
A $\textbf {Binomial Distribution}$ can be thought of as simply the probability of a SUCCESS or FAILURE outcome in an experiment or survey that is repeated multiple times. The binomial is a type of distribution that has two possible outcomes (the prefix “bi” means two, or twice). $\textbf {For example,}$ a coin toss ...
github_jupyter
# Wide-field imaging demonstration This script makes a fake data set, fills it with a number of point components, and then images it using a variety of algorithms. See imaging-fits for a similar notebook that checks for errors in the recovered properties of the images. The measurement equation for a wide field of vie...
github_jupyter
``` import sys import os import PIL import numpy as np from numpy.linalg import norm from math import * from scipy import ndimage from scipy import misc import skimage from sympy import * %matplotlib inline import matplotlib.pyplot as plt def estimateModelAttempt1(): r,g = symbols('r g') a0,r0,g0 = symbols('...
github_jupyter
``` #!/usr/bin/env python # coding: utf-8 # In[1]: import os import pickle import re import shutil from collections import defaultdict import matplotlib.pyplot as plt import numpy as np import pandas as pd import pylab import skimage.io as io import torch from mpl_toolkits.axes_grid1 import ImageGrid from PIL import ...
github_jupyter
``` import pandas as pd import mysql.connector as sql from geopy.geocoders import Nominatim import geopy.geocoders pd.options.display.max_colwidth = 200 indices = ['hoou','oerinfo','hhu','openrub','digill','zoerr', 'tibav', 'oncampus'] col_names = [ "name", "about", "author", "publisher", "inLangu...
github_jupyter
``` import pandas as pd pd.set_option("display.max_columns", None) marine = pd.read_csv('data_processed/MarineLitterWatch_totals_by_category.csv') tides = pd.read_csv('data_processed/TIDES_earth_totals_by_category.csv') mdmap = pd.read_csv('data_processed/mdmap_totals_by_category.csv') mdmap['Dataset'] = 'MDMAP' tides[...
github_jupyter
* Hyperparameter tuning of the 5 classifiers for emotional state detection * 5 fold cross validation with grid-search * Multiclass classification ``` import pandas as pd import datetime import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from pprint import pprint from sklearn.model_selection i...
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
# Recommending movies: ranking **Learning Objectives** 1. Get our data and split it into a training and test set. 2. Implement a ranking model. 3. Fit and evaluate it. ## Introduction The retrieval stage is responsible for selecting an initial set of hundreds of candidates from all possible candidates. The main ...
github_jupyter
[![imagenes/pythonista.png](imagenes/pythonista.png)](https://pythonista.io) # Seguridad y autenticación básicas. *Django* cuenta desde su instalación con un sistema simple de: * Gestión de usuarios. * Gestión de grupos. * Autenticación básica. * Gestión de sesiones. La documentación correspondiente puede ser consu...
github_jupyter
``` !pip install d2l==0.17.2 ``` # Concise Implementation of RNNs Now we will see how to implement the same language model more efficiently using functions provided by high-level PyTorch APIs. We begin as before by reading the time machine dataset. ``` import torch from torch import nn from torch.nn import functional...
github_jupyter
# Soccerstats Predictions v0.5 The changelog from v0.4: * Try to implement the *MulticlassClassificationEvaluator* evaluator for the random-forest model. * Use the *accuracy* metric to evaluate the random-forest model. ## A. Data Cleaning & Preparation ### 1. Read csv file ``` # load and cache data stat_df = sqlCon...
github_jupyter
``` import os import glob import sys import requests import copy import json import pickle import pandas as pd import matplotlib.pyplot as plt import numpy as np import tensorflow as tf sys.path.append(os.path.join(os.pardir,"src")) import build_dataset as ds import cg_optimisers as cg_opt import plotter ``` # RSMI o...
github_jupyter
# Deep Q-learning In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called [Cart-Pole](https://gym.openai.com/envs/CartPole-v0). In this game, a freely swinging pole is attached to a cart....
github_jupyter
### Eco 100 diagrams ## Linear Demand and Supply Diagram This is a jupyter notebook to generate a simple interactive supply and demand diagram using python and `ipywidgets` (interactive HTML widgets) to provide sliders and animations. To run this notebook first run the code cells in the [code Section](#Code-Section)...
github_jupyter
# Plan: * Prepare input with extracted UASTs * Filter data from DB (if needed) * Prepare pairs (provide specific requirements if needed) * Statistics & visualization * Export datasets ``` %matplotlib inline from collections import defaultdict, deque from datetime import datetime from glob import glob import os import ...
github_jupyter
# ClickHouse. Аналитические функции ``` import pandas as pd import numpy as np df = pd.read_csv('/content/drive/MyDrive/dataset/clickhouse_data.csv', sep=';', parse_dates=['dt']) df.info() %%capture !sudo apt-get install apt-transport-https ca-certificates dirmngr !sudo apt-key adv --keyserver hkp://keyserver.ubuntu.c...
github_jupyter
##### Copyright 2021 The C-HACKMASTERS. ``` # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
github_jupyter
# Tutorial: Confidence Intervals By Delaney Granizo-Mackenzie, Jeremiah Johnson, and Gideon Wulfsohn Part of the Quantopian Lecture Series: http://www.quantopian.com/lectures http://github.com/quantopian/research_public Notebook released under the Creative Commons Attribution 4.0 License. ## Sample Mean vs. Popula...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/release_notebooks/NLU1.1.2_Bengali_ner_Hindi_Embeddings_30_new_models.ipynb) ``` import os f...
github_jupyter
# GOES-16 IR channel subregion plot (using reprojected data) This jupyter notebook shows how to make a sub-region plot of a **reprojected** IR channel of GOES-16. Import the GOES package. ``` import GOES ``` Set path and name of file that will be read. ``` path = '/home/joao/Downloads/GOES-16/ABI/' file = 'OR_ABI-L...
github_jupyter
# Project 2: inverse kinematics and resolved rate control In this project, we will implement an inverse kinematics algorithm and controllers for the Kuka iiwa 14 robot using the results from Project 1. ## Instructions * Answer all questions in the notebook * You will need to submit on Brightspace: 1. the code yo...
github_jupyter
# Gathering historical data about the addition of newspaper titles to Trove The number of digitised newspapers available through Trove has increased dramatically since 2009. Understanding when newspapers were added is important for historiographical purposes, but there's no data about this available directly from Trov...
github_jupyter
``` # # download example data # # !pip install gdown # from downloaddata import download_example_data # download_example_data() %config IPCompleter.use_jedi = False from wholeslidedata.iterators import create_batch_iterator from wholeslidedata.image.wholeslideimagewriter import WholeSlideMaskWriter, HeatmapTileCallback...
github_jupyter
``` # 计算每个点之间的距离 from collections import defaultdict class Solution: def shortestSuperstring(self, A): def calc(word1, word2): # 计算两个单词之间的 distance n1, n2 = len(word1), len(word2) right = 0 for i in range(n1): if word1[i] == word2[right]: ...
github_jupyter
SOP0125 - Delete Key For Encryption At Rest =========================================== Description ----------- Use this notebook to connect to the `controller` database and delete a key from controller database. For restoring keys with names which exist in the target deployment, the key with the conflicting name nee...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/iconix/openai/blob/master/Interactive_textgenrnn_Demo_w_GPU.ipynb) # Interactive textgenrnn Demo w/ GPU by [Max Woolf](http://minimaxir.com) Generate text using a pretrained neural network with a few lines of code, or easily train your own text-generat...
github_jupyter
# About this Jupyter Notebook @author: Yingding Wang ### Useful JupyterLab Basic Before start, you may consider to update the jupyterlab with the command <code>python !{sys.executable} -m pip install --upgrade --user jupyterlab </code> 1. Autocomplete syntax with "Tab" 2. View Doc String with "Shift + Tab" 3...
github_jupyter
# Introduction to zfit In this notebook, we will have a walk through the main components of zfit and their features. Especially the extensive model building part will be discussed separately. zfit consists of 5 mostly independent parts. Other libraries can rely on this parts to do plotting or statistical inference, su...
github_jupyter
``` # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # dist...
github_jupyter
**Chapter 10 – Introduction to Artificial Neural Networks with Keras** _This notebook contains all the sample code and solutions to the exercises in chapter 10._ <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/10_neural_nets_with_keras.i...
github_jupyter
# Iterators and Generators In the section on loops we introduced the `range` function, and said that you should think about it as creating a list of numbers. In Python `2.X` this is exactly what it does. In Python `3.X` this is *not* what it does. Instead it creates the numbers one at a time. The difference in speed a...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') #!pip install tensorflow keras gensim scikit-learn import numpy as np import tensorflow as tf from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from gensim.models impor...
github_jupyter
# Python syntax cheat sheet This is a quick overview and reference for many of the fundamentals that we might not have time to stop and go through in detail: - [Basic data types](#Basic-data-types) - [Strings](#Strings) - [Numbers](#Numbers) - [Booleans](#Booleans) - [Variable assignment](#Variable-assign...
github_jupyter
## Comparing Image Data Structures ``` # OpenCV supports reading of images in most file formats, such as JPEG, PNG, and TIFF. Most image and # video analysis requires converting images into grayscale first. This simplifies the image and reduces # noise allowing for improved analysis. Let's write some code that reads...
github_jupyter
# Object oriented programming ## Using an object Below is the definition of an object. Run the cell and create at least two instances of it. ``` class Car: def __init__(self, make, model, year, mpg=25, tank_capacity=30.0, miles=0): self.make = make self.model = model self.year = year...
github_jupyter
``` #Import the math function for calculations import math import tensorflow as tf import numpy as np #Class that defines the behavior of the RBM class RBM(object): def __init__(self, input_size, output_size, lr=1.0, batchsize=100): """ m: Number of neurons in visible layer n: number of...
github_jupyter
# Кратчайшие пути Существуют вариации в зависимости от конкретного случая, но обычно базовой задачей о кратчайших путях считают следующую: дана вершина $s$, найти пути миниальной длины (длина пути -- сумма длин образующих его ребер) до всех остальных вершин. В случае, если длины всех ребер одинаковы, то эта задача реш...
github_jupyter
# Model factory Single-link models can be easily generated using a few parameters. ``` from pcg_gazebo.generators.creators import create_models_from_config from pcg_gazebo.task_manager import Server import os # Start an empty world Gazebo simulation server = Server() server.create_simulation('default') simulation = ...
github_jupyter
### - Split Compounds into Train & Test data based on the number of MOAs that are attributed to them. ``` import os import pathlib import requests import pickle import argparse import pandas as pd import numpy as np import re from os import walk from collections import Counter import random import shutil from split_co...
github_jupyter
# Basic MNIST Example This basic example shows loading from a YAML file. You can specify all the parameters in the yaml file, but we're going to load the raw data using tensorflow. ``` import numpy as np import tensorflow as tf from pygoko import CoverTree mnist = tf.keras.datasets.mnist (x_train, y_train),(x_test, ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import random from torch import optim from tqdm import tqdm import numpy as np import pandas as pd import string import torch import re from torch.utils.data import Dataset, DataLoader from transformers import AutoTokenizer from transformers import BertConfig, BertTokenizer fro...
github_jupyter
# 20. Transfer Learning with Inception v3 ``` import torch import torch.nn as nn from torch.utils.data import DataLoader from torchvision import models import torchvision.utils import torchvision.datasets as dsets import torchvision.transforms as transforms import numpy as np import matplotlib.pyplot as plt %matplot...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Reducer/min_max_reducer.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href...
github_jupyter
``` import numpy as np from pycalphad import Model, Database, calculate, equilibrium from pycalphad.core.compiled_model import CompiledModel import pycalphad.variables as v from pycalphad.tests.datasets import ISSUE43_TDB dbf = Database(ISSUE43_TDB) models = {key: CompiledModel(dbf, ['AL', 'NI', 'CR', 'VA'], key, _debu...
github_jupyter
# FloPy ### SWI2 Example 1. Rotating Interface This example problem is the first example problem in the SWI2 documentation (http://pubs.usgs.gov/tm/6a46/) and simulates transient movement of a freshwater\seawater interface separating two density zones in a two-dimensional vertical plane. The problem domain is 250 m l...
github_jupyter
``` def bingo(board,targetNum): for line in board: for i, num in enumerate(line): if num==targetNum: line[i]=-1 return board def isWin(board): for i in range(5): #rows if board[i][0]!=-1: continue else: allEqual=True for...
github_jupyter
# Deconvolution Validation Parameterized notebook to analyze a single dataset in a comparison between Flowdec and DeconvolutionLab2 ``` import tempfile, os, warnings, timeit, math import pandas as pd import numpy as np import papermill as pm import matplotlib.pyplot as plt import plotnine as pn import io as pyio from...
github_jupyter