text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
#hide
from utils import *
```
# A fastai Learner from Scratch
## Data
```
path = untar_data(URLs.IMAGENETTE_160)
t = get_image_files(path)
t[0]
from glob import glob
files = L(glob(f'{path}/**/*.JPEG', recursive=True)).map(Path)
files[0]
im = Image.open(files[0])
im
im_t = tensor(im)
im_t.shape
lbls = files.map(... | github_jupyter |
# High-performance simulations with TFF
This tutorial will describe how to setup high-performance simulations with TFF
in a variety of common scenarios.
Note: The mechanisms covered here are not included in the latest release, have
not been tested yet, and the API may evolve. In order to follow this tutorial,
you wil... | github_jupyter |
<center><h1 style="font-size:40px;">Exercise II:<br> Multi-layer perceptrons
for classification and regression problems.
</h1></center>
---
# Introduction
Welcome to the second lab in the Deep learning course! In this lab we will continue to take a look at four parts for MLP classification;
* Introduction for setup ... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from neural_circuits.LRRNN import get_W_eigs_np
import numpy as np
import os
import pickle
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
import torch
torch.manual_seed(0)
import tensorflow as tf
from epi.models import Model, Parameter
from epi.util impo... | github_jupyter |
SOP010 - Upgrade a big data cluster
===================================
Upgrade a Big Data Cluster using `azdata`.
Steps
-----
### Parameters
```
docker_image_tag = f"<enter here>" # i.e. 15.0.4003.10029_2
print('PARAMETERS:')
print('')
print(f'docker_image_tag = {docker_image_tag}')
print('')
```
### Common func... | github_jupyter |
# Introduction
It can be a troubling time, but we do have hope on the horizon, with the news we get daily about vaccines. Multiple companies are releasing and getting their vaccines approved; we may soon see a path forward.
Using the robust toolset provided by Kaggle, I'll show you how to create an interactive map ... | github_jupyter |
# 函数
- 函数可以用来定义可重复代码,组织和简化
- 一般来说一个函数在实际开发中为一个小功能
- 一个类为一个大功能
- 同样函数的长度不要超过一屏
## 定义一个函数
def function_name(list of parameters):
do something

- 以前使用的random 或者range 或者print.. 其实都是函数或者类
```
def LYX():
print('Hi')
LYX()#调用函数()用括号调用
LYX()
def LYX():
print('Hi')
a = LYX()
print(a)
def... | github_jupyter |
#1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
```
!pip install git+https://github.com/google/starthinker
```
#2. Get Cloud Project ID
To run this recipe [requires a Google Cloud Project](https://github.com/google/starthinker/blob/mast... | github_jupyter |
# Capítulo 6 - Uso de Appium para automatizar acciones en dispositivos
___
## Conectar un dispositivo
___
### Pasos comunes
Para conectar un dispositivo de Android hay que seguir los siguientes pasos:
1. Descargar e instalar Java jdk 1.8: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.h... | github_jupyter |
# Week 3 - Quiz Assignment
1) Assume that the chain rule is used to compute the joint probability of the sentence $P('\text{I got this one}') $. The products of probabilities are represented by
$P(got|I) \times P(this|I,got) \times P(one|I,got,this)$
- True
- False
__Answer__: False
It should be $P(I) \times P(g... | github_jupyter |
# Object formatters
## Default formatting behaviors
When you return a value or a display a value in a .NET notebook, the default formatting behavior is to try to provide some useful information about the object. If it's an array or other type implementing `IEnumerable`, that might look like this:
```
display ["hello... | github_jupyter |
# BDF Introduction
The Jupyter notebook for this demo can be found in:
- docs/quick_start/demo/bdf_demo.ipynb
- https://github.com/SteveDoyle2/pyNastran/tree/master/docs/quick_start/demo/bdf_demo.ipynb
Import pyNastran
```
import os
import pyNastran
print (pyNastran.__file__)
print (pyNastran.__version__)
pkg_... | github_jupyter |
```
import os, numpy, warnings
import pandas as pd
os.environ['R_HOME'] = '/home/gdpoore/anaconda3/envs/tcgaAnalysisPythonR/lib/R'
warnings.filterwarnings('ignore')
%config InlineBackend.figure_format = 'retina'
%reload_ext rpy2.ipython
%%R
require(ggplot2)
require(snm)
require(limma)
require(edgeR)
require(dplyr)
req... | github_jupyter |
# Install Transformers Library
```
!pip install transformers==3.0.2
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
import transformers
from transformers import AutoModel, BertTokenizerFast
... | github_jupyter |
```
# Import external resources
import json
from allennlp.common.util import import_submodules
from allennlp.models.archival import load_archive
from allennlp.predictors import Predictor
from collections import defaultdict
from typing import List
# Change the working directory to be the root of the Github repo
# so tha... | github_jupyter |
# 1) Data Preprocessing
---
```
import tensorflow as tf
print(tf.__version__)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_s... | github_jupyter |
### Problem-1
In this problem we use the ColumnarStructure and boolean indexing to create a distance map of the HIV protease dimer. We will use C-beta atoms instead of C-alpha atoms.
```
from pyspark.sql import SparkSession
from mmtfPyspark.io import mmtfReader
from mmtfPyspark.utils import traverseStructureHierarchy,... | github_jupyter |
## Iris Flower dataset classification
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
'''downlaod iris.csv from https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv'''
#Load Iris.csv into a pandas dataFrame.
iris = pd.read_csv("iris.csv")
# (Q) ... | github_jupyter |
```
import os
os.chdir('..')
from pathlib import Path
import json
```
# Paths
```
coco_train_path = Path('data')/'benign_data'/'coco_train.json'
coco_test_path = Path('data')/'benign_data'/'coco_test.json'
coco_eval_path = Path('data')/'benign_data'/'coco_eval.json'
data_dir = Path('data')/'benign_data'
eval_coco_pa... | github_jupyter |
# Using Ax for Human-in-the-loop Experimentation¶
While Ax can be used in as a fully automated service, generating and deploying candidates Ax can be also used in a trial-by-trial fashion, allowing for human oversight.
Typically, human intervention in Ax is necessary when there are clear tradeoffs between multiple m... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
```
# FP16
In this notebook we are going to implement mixed precision floating points.
By default, all computations are done in single-precision which means that all the floats (inputs, activations and weights) are 32-bit floats. If we could use 16-bit floats for each of these... | github_jupyter |
Peakcalling Peak Stats
================================================================
This notebook is for the analysis of outputs from the peakcalling pipeline relating to the quality of the peakcalling steps
There are severals stats that you want collected and graphed - you can click on the links below to find th... | github_jupyter |
```
%pylab inline
import numpy as np
import torch
import os
from torch import nn
from torch import optim
from torch.nn import functional as F
from torch import autograd
from torch.autograd import Variable
import nibabel as nib
from torch.utils.data.dataset import Dataset
from torch.utils.data import dataloader
from nil... | github_jupyter |
This notebook is adapted from a lesson from the 2019 [KIPAC/StatisticalMethods course](https://github.com/KIPAC/StatisticalMethods), (c) 2019 Adam Mantz and Phil Marshall, licensed under the [GPLv2](LICENSE).
# Generative Models and Probabilistic Graphical Models
Goals:
* Introduce generative models in the context of... | github_jupyter |
# 02 - Introduction to Python for Data Analysis
by [Alejandro Correa Bahnsen](http://www.albahnsen.com/) & [Iván Torroledo](http://www.ivantorroledo.com/)
version 1.2, Feb 2018
## Part of the class [Machine Learning for Risk Management](https://github.com/albahnsen/ML_RiskManagement)
This notebook is licensed unde... | github_jupyter |
### **Importing Libraries** <a id="head1"></a>
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.decomposition import PCA
from sklearn.model_s... | github_jupyter |
# Exploring SQLAlchemy Joins a Touch
First we need to setup our environment to answer the questions from the blog post
* Setting up our ORM objects
* Creating the tables in a SQLite database
* Configuring and initializing a session for us to use for our exploration
```
from datetime import datetime
from sqlalchemy i... | github_jupyter |
## Selecting airport hubs for a new airline
The problem of facility location is common to industries that have physical locations ("facilities") and need to identify the best new location as their business grows. There are numerous examples of this, ranging from chain stores and restaurants trying to open new location... | github_jupyter |
<a href="https://colab.research.google.com/github/TarrySingh/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials/blob/master/TensorFlow_2_0_%2B_Keras_Crash_Course.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install tensorfl... | github_jupyter |
# GLM: Robust Linear Regression
Author: [Thomas Wiecki](https://twitter.com/twiecki)
This tutorial first appeard as a post in small series on Bayesian GLMs on my blog:
1. [The Inference Button: Bayesian GLMs made easy with PyMC3](http://twiecki.github.com/blog/2013/08/12/bayesian-glms-1/)
2. [This world is far f... | github_jupyter |
# Live Data
The 'Getting Started' guide has up until this point demonstrated how HoloViews objects can wrap your data and be given a rich, useful representation. All of the visualizations assumed that the data was already available in memory so that it could be used to construct the appropriate object, and all of the ... | github_jupyter |
# SIT742: Modern Data Science
**(Week 06: Big Data Platform (I))**
---
- Materials in this module include resources collected from various open-source online repositories.
- You are free to use, change and distribute this package.
- If you found any issue/bug for this document, please submit an issue at [tulip-lab/si... | github_jupyter |
```
import pyscisci.all as pyscisci
import os
import networkx as nx
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
try:
import seaborn as sns
sns.set_style('white')
from cdlib import algorithms
from clusim.clustering import Clustering
except:
print('This example ... | github_jupyter |
```
%pylab inline
```
# Shift-Ciphers
A shift-cipher, or ROT cipher, is a pretty simple encryption. First we convert all the letters into digits, which is a function $f : \{ a \to 0, b \to 1, \ldots \}$, the inverse of this is $f^{-1} : \{0 \to a, 1 \to b, \ldots \}$.
First we convert all the letters to digits, the... | github_jupyter |
This notebook first displays the location of PROMICE AWSs and calculated the annual velocity based on the GPS record.
Then it will extract the satellite pixel values and MODIS albedo prodcut at each AWS site.
Results will be saved in csv files under the promice folder.
Users should change the size of spatial window ... | github_jupyter |
# Time Series Analysis
San Francisco International Airport (IATA code: SFO) is located south of San Francisco downtown and it’s a very important air transportation hub for both domestic and international flights.
It is equipped with four asphalt runways – two perpendicular pairs.
This airport is one of the main hu... | github_jupyter |
# 23. Natural Language for Communication
**23.1** \[washing-clothes-exercise\]Read the following text once for
understanding, and remember as much of it as you can. There will be a
test later.
> The procedure is actually quite simple. First you arrange things into
different groups. Of course, one pile may be sufficie... | github_jupyter |
```
import os
import torch
os.environ['CUDA_VISIBLE_DEVICES'] = '0,1'
from datetime import datetime
from models.handler import train, test, validate
import pandas as pd
from models.base_model import Model
import numpy as np
import json
from data_loader.forecast_dataloader import ForecastDataset
import torch.u... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

# Training Pipeline - Au... | github_jupyter |
```
import os, sys
sys.path.append("../")
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
from matplotlib import gridspec
import numpy as np
from scipy.optimize import minimize
from scipy.stats import chi2
from tqdm import *
from grf.grf import FIRAS
from grf.units import *
from grf... | github_jupyter |
```
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import tensorflow as tf
tf_config = tf.ConfigProto()
tf_config.gpu_options.allow_growth = True
sess = tf.Session(config=tf_config)
import keras
import pandas as pd
import numpy as np
from sklearn.model_selection im... | github_jupyter |
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a>
$ \newcommand{\bra}[1]{\langle #1|} $
$ \newcommand{\ket}[1]{|#1\rangle} $
$ \newcommand{\braket}[2]{\langle #1|#2\rangle} $
$ \newcommand{\dot}[2]{ #1 \cdot #2} $
$ \newcommand{\biginner}[2]{\left\langle... | github_jupyter |
# Iterating with .iterrows()
In the video, we discussed that .iterrows() returns each DataFrame row as a tuple of (index, pandas Series) pairs. But, what does this mean? Let's explore with a few coding exercises.
A pandas DataFrame has been loaded into your session called pit_df. This DataFrame contains the stats for ... | github_jupyter |
# Power Outages
This project uses major power outage data in the continental U.S. from January 2000 to July 2016. Here, a major power outage is defined as a power outage that impacted at least 50,000 customers or caused an unplanned firm load loss of atleast 300MW. Interesting questions to consider include:
- Where an... | github_jupyter |
# Web Scraping using Selenium and Beautiful Soup
Selenium is a browser automation tool that can not only be used for testing, but also for many other purposes. It's especially useful because using it we can also scrape data that are client side rendered.
Installation:
```
!pip install selenium
```
or
```
!conda ins... | github_jupyter |
```
from utils import *
import tensorflow as tf
from sklearn.cross_validation import train_test_split
import time
trainset = sklearn.datasets.load_files(container_path = 'data', encoding = 'UTF-8')
trainset.data, trainset.target = separate_dataset(trainset,1.0)
print (trainset.target_names)
print (len(trainset.data))
p... | github_jupyter |
<img align="right" src="images/tf-small.png" width="128"/>
<img align="right" src="images/etcbc.png"/>
<img align="right" src="images/dans-small.png"/>
You might want to consider the [start](search.ipynb) of this tutorial.
Short introductions to other TF datasets:
* [Dead Sea Scrolls](https://nbviewer.jupyter.org/gi... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/gdrive')
```
Model for RAVDESS dataset using 1d Convolutions
```
import librosa
def noise(data):
"""
Adding White Noise.
"""
# you can take any distribution from https://docs.scipy.org/doc/numpy-1.13.0/reference/routines.random.html
noise_a... | github_jupyter |
# Solución del Reto Equipo 9
```
# Importar librerías
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from collections import Counter
# Asignar 'data' al documento CSV
data = pd.read_csv("covid19_tweets.csv")
# Followers
# Max número de seguidores: 13 892 840
sub_df_followers = data[data['u... | github_jupyter |
# Chapter 11: Classes & Instances (Review Questions)
The questions below assume that you have read the [first <img height="12" style="display: inline-block" src="../static/link/to_nb.png">](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/11_classes/00_content.ipynb), [second <img height="12... | github_jupyter |
# Mount Drive
```
from google.colab import drive
drive.mount('/content/drive')
!pip install -U -q PyDrive
!pip install httplib2==0.15.0
import os
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from pydrive.files import GoogleDriveFileList
from google.colab import auth
from oauth2client.clien... | github_jupyter |
# IBM Watson OpenScale Lab instructions
This notebook should be run in a Watson Studio project, using the **Default Spark Python 3.6** runtime environment. **If you are viewing this in Watson Studio and do not see `Python 3.6 with Spark` in the upper right corner of your screen, please update the runtime now.** It req... | github_jupyter |
# Time Series Prediction
**Objectives**
1. Build a linear, DNN and CNN model in Keras.
2. Build a simple RNN model and a multi-layer RNN model in Keras.
In this lab we will start with a linear, DNN and CNN model
Since the features of our model are sequential in nature, we'll next look at how to build various RNN... | github_jupyter |
# Module 4. Custom Metric 으로 성능 데이터 및 Cold Start 성능 체크 하기
이번 모듈에서는 모듈2에서 테스트 용으로 분리했던 데이터를 가지고 Custom 지표를 통해 추가적인 성능을 평가해 보도록 합니다.
또한 Coldstart 성능도 추가적으로 확인해 보도록 합니다.
```
import pandas as pd, numpy as np
import io
import scipy.sparse as ss
import json
import time
import os
import boto3
import uuid
from botocore.excep... | github_jupyter |
```
#pip install --upgrade tensorflow
import tensorflow as tf
print(tf.__version__)
# Small LSTM Network to Generate Text for
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.callbacks import ModelCheckpoint
from k... | github_jupyter |
# Introduction to Spark
Using Spark we are going to read in this data and calculate the average age. First, we need to initialize a SparkSession:
```
from pyspark.sql import SparkSession
spark = SparkSession \
.builder \
.appName("Spark Example") \
.getOrCreate()
```
Let’s go ahead and create a Spark Dat... | github_jupyter |
# Baesyan Data Analysis Course - Chapter 3 Exercises
https://github.com/avehtari/BDA_course_Aalto/tree/master/exercises
### Exercise 1 - Inference for normal mean and deviation
A factory has a production line for manufacturing car windshields. A sample of windshields has been taken for testing hardness (sample of ob... | github_jupyter |
```
# # google colab tesla P100
# ! pip install numpy==1.17.4 scipy==1.3.1 pandas==0.25.3 tensorflow-gpu==2.0.0 torch==1.3.1 torchvision==0.4.2 scikit-learn==0.21.3
# ! pip install transformers==2.2.1
# ! pip install git+https://github.com/huggingface/transformers.git
# # linux系統指令 可省略 win可能跑不了
# ! nvidia-smi
# ! lscpu... | 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 |
# NXP imx8qm x AWS NEO Object Detection Example
1. [Introduction](#Introduction)
2. [Compile model using NEO](#Compile-model-using-NEO)
3. [Inference on device](#Inference-on-device)
## Introduction
This notebook will demo how to compile pretrained Gluoncv ssd mobilenet model using AWS Neo for NXP imx8qm. First, we ... | github_jupyter |
# Version information
```
from datetime import date
print("Running date:", date.today().strftime("%B %d, %Y"))
import pyleecan
print("Pyleecan version:" + pyleecan.__version__)
import SciDataTool
print("SciDataTool version:" + SciDataTool.__version__)
```
# How to define a simulation to call FEMM
This tutorial shows... | github_jupyter |
# Deep CNN Models
Constructing and training your own ConvNet from scratch can be Hard and a long task.
A common trick used in Deep Learning is to use a **pre-trained** model and finetune it to the specific data it will be used for.
## Famous Models with Keras
This notebook contains code and reference for the follow... | github_jupyter |
# Probabilistic Grammar Fuzzing
Let us give grammars even more power by assigning _probabilities_ to individual expansions. This allows us to control how many of each element should be produced, and thus allows us to _target_ our generated tests towards specific functionality. We also show how to learn such probabil... | github_jupyter |
# AWS Elastic Kubernetes Service (EKS) Deep MNIST
In this example we will deploy a tensorflow MNIST model in Amazon Web Services' Elastic Kubernetes Service (EKS).
This tutorial will break down in the following sections:
1) Train a tensorflow model to predict mnist locally
2) Containerise the tensorflow model with o... | github_jupyter |
<a href="https://colab.research.google.com/github/pranjaldatta/PyVision/blob/master/demo/segmentation/pspnet/pspnet_demo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Pyramid Scene Parsing Net (PSPNet) demonstration notebook
This is a stand al... | github_jupyter |
```
from IPython.display import display
from IPython.display import HTML
import IPython.core.display as di # Example: di.display_html('<h3>%s:</h3>' % str, raw=True)
# This line will hide code by default when the notebook is exported as HTML
di.display_html('<script>jQuery(function() {if (jQuery("body.notebook_app").l... | github_jupyter |
# "Qakbot / Qbot"
> Qakbot config extraction
- toc: true
- badges: true
- categories: [qakbot,qbot,malware,config]
## Overview
Sample (unpacked): `670e990631c0b98ccdd7701c2136f0cb8863a308b07abd0d64480c8a2412bde4`
References:
- [Unpacked Sample - Malshare](https://malshare.com/sample.php?action=detail&hash=670e9906... | github_jupyter |
# Autoregressions
This notebook introduces autoregression modeling using the `AutoReg` model. It also covers aspects of `ar_select_order` assists in selecting models that minimize an information criteria such as the AIC.
An autoregressive model has dynamics given by
$$ y_t = \delta + \phi_1 y_{t-1} + \ldots + \phi_... | github_jupyter |
# Variational inference for Bayesian neural networks
This article demonstrates how to implement and train a Bayesian neural network with Keras following the approach described in [Weight Uncertainty in Neural Networks](https://arxiv.org/abs/1505.05424) (*Bayes by Backprop*). The implementation is kept simple for illus... | github_jupyter |
# Optimization and Deep Learning
In this section, we will discuss the relationship between optimization and deep learning as well as the challenges of using optimization in deep learning.
For a deep learning problem, we will usually define a *loss function* first. Once we have the loss function, we can use an optimiza... | github_jupyter |
# Calculate and save extremes (both atm and lnd)
## 1. Settings
### 1.1 Import the necessary python libraries
```
from __future__ import print_function
import sys
import os
from getpass import getuser
import string
import subprocess
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import netCDF4 ... | github_jupyter |
# Heartattack Data
Data taken from: https://www.kaggle.com/carlosdg/a-detail-description-of-the-heart-disease-dataset
```
# Load packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Enable multiple outputs per cell
from IPython.core.interactiveshell import Interact... | github_jupyter |
# Softmax exercise
*Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.*
This exercise is ... | github_jupyter |
# Proximal Policy Optimization (PPO)
## 背景
Proximal Policy Optimization,简称PPO,即近端策略优化,是对Policy Graident,即策略梯度的一种改进算法。PPO的核心精神在于,通过一种被称之为Importce Sampling的方法,将Policy Gradient中On-policy的训练过程转化为Off-policy,即从在线学习转化为离线学习,某种意义上与基于值迭代算法中的Experience Replay有异曲同工之处。通过这个改进,训练速度与效果在实验上相较于Policy Gradient具有明显提升。
## Policy Gradien... | github_jupyter |
```
import os
# os.environ["CUDA_VISIBLE_DEVICES"]="0"
import re
import json
import string
import numpy as np
import tensorflow as tf
from pprint import pprint
from tensorflow import keras
from tensorflow.keras import layers
from tokenizers import BertWordPieceTokenizer
from transformers import RobertaTokenizer, Robert... | github_jupyter |
# 12. Semantics 2 - Lab excercise
## Improving a baseline Sentiment Analysis algorithm
Below is a small system for training and testing a Support Vector classifier on sentiment analysis data from the 2017 Semeval Task 4a, containing English tweets.
Currently the system only contains a single feature type: each tweet... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
# reset defalult plotting values
plt.rcParams['figure.figsize'] = (10, 7)
plt.rc('font', family='sans-serif')
plt.rc('axes', labelsize=14)
plt.rc('axes', labelweight='bold')
plt.rc('axes', titlesize=16)
plt.rc('axes', titleweight='bold')
plt.rc('... | github_jupyter |
# NOTE
Unfortunately the `desimodel.focalplane.on_tile_gfa()` code had a bug in the 18.6 and 18.7
software releases, where it would fail in the case of no input targets overlapping and GFAs.
This will be fixed before the next release but for now this tutorial doesn't work.
We are also updating how GFA targets are pre... | github_jupyter |
# python 2.4
- pep8, clean code
- typehints
- mypy
- enum
- pytest
# PEP8
* PEP8 is recommendation, not rule (but it's valuable to follow)
* there are also tools for
* linting code (`pip install pep8`)
* autoformatting (`pip install black`)
* see more https://realpython.com/python-pep8/
* imports in header of ... | github_jupyter |
```
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
import json
import pandas as pd
import numpy as np
import plotly
from IPython import display
import os
def show_app(app, port = 9999,
... | github_jupyter |
<a href="https://colab.research.google.com/github/Ducksss/Project-Cactus/blob/main/Project_Cactus_(Training).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<div id="top"></div>
<!-- PROJECT SHIELDS -->
<!--
*** I'm using markdown "reference style"... | github_jupyter |
# Section I. INTRODUCTION
# Chapter 1. What is Robotics?
What is a robot?
----------------
It might come as a surprise that it is actually tricky to define the
word "robot." Contrast the idea of a science fiction android with a
remote control flying drone. The android (appears) to think, feel, and
move with the ... | github_jupyter |
#CM360 Data Warehouse
Deploy a BigQuery dataset mirroring CM360 account structure. Foundation for solutions on top.
#License
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... | github_jupyter |
<table align="center">
<td align="center"><a target="_blank" href="http://introtodeeplearning.com">
<img src="https://i.ibb.co/Jr88sn2/mit.png" style="padding-bottom:5px;" />
Visit MIT Deep Learning</a></td>
<td align="center"><a target="_blank" href="https://colab.research.google.com/github/aamini/in... | github_jupyter |
```
import random
from tracery import Grammar, modifiers
import tracery_alterations
from collections import namedtuple
import pycorpora
class Question(namedtuple('Question',
['id','questions','answers','additional_tags'])):
def instantiate(self, n=2):
if n=='lambda':
re... | github_jupyter |
# mmdcornea
Cornea cells marking.
## Description
This procedure creates a maker for each cell in a very poor quality microscopic image of a cornea. The composition of an opening with the regional maximum is used to create the markers.
```
import numpy as np
from PIL import Image
import ia870 as ia
```
# Reading and ... | github_jupyter |
# Advanced Bayes Search CV Example
This is a more advanced example of how the `BayesSearchCV` class can be applied - it's recommended that you first read through the simpler `bayes_search_cv_example`.
The `BayesSearchCV` class is used to search for the set of hyperparameters that produce the best decision engine perf... | github_jupyter |
# Preparing news vectors
We want to use [word2vec] pre-computed word vectors to approximate
the semantic distance between user queries and dictionary definitions.
See Daniel Dacanay, Antti Arppe, and Atticus Harrigan, [Computational Analysis versus Human Intuition: A Critical Comparison of Vector Semantics with Manua... | github_jupyter |
```
# %%
import pandas as pd
from datetime import datetime
import numpy as np
from pathlib import Path
import matplotlib.pylab as pl
# %%
# CONFIGS
class pathMap():
def __init__(self) -> None:
scratch = '/scratch/enis/data/nna/'
home = '/home/enis/projects/nna/'
self.data_folder = home +... | github_jupyter |
```
import dgl.nn as dglnn
from dgl import from_networkx
import torch.nn as nn
import torch as th
import torch.nn.functional as F
import dgl.function as fn
from dgl.data.utils import load_graphs
import networkx as nx
import pandas as pd
import socket
import struct
import random
from sklearn.preprocessing import LabelEn... | github_jupyter |
##### Copyright 2019 The TensorFlow Probability Authors.
Licensed under the Apache License, Version 2.0 (the "License");
```
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | github_jupyter |
Here is the base code for takings paragraphes of dpef and splitting them into sentences, then keep only long sentences.
MIN_NB_OF_TOKENS=8 seems to do the trick.
Improvements:
- Remove last filter and look at what has <8 words. Mostly fragments, mainly titles, etc. but may shows errors in parsing.
- Questions were k... | github_jupyter |
<a href="https://colab.research.google.com/github/yukinaga/ai_programming/blob/main/lecture_06/03_exercise.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# 演習
Tensorflowベースのアート関連ライブラリ「Magenta」を使います。
Magenta内のモデル「Music VAE」を使って、自由に作曲しましょう。
主に、 曲... | github_jupyter |
Visualizing NBA Shots with `py-Goldsberry`
===
One of the coolest features of `py-Goldsberry` is access to raw data for NBA shots.
Visualizing NBA shot charts as a method of analytics was proposed by Kirk Goldsberry at the 2012 MIT Sloan Sports Analytics Conference ([read paper](http://www.sloansportsconference.com/... | github_jupyter |
# CSE 6040, Fall 2015 [14]: PageRank (still cont'd)
> This notebook is identical to [Lab 13](http://nbviewer.ipython.org/github/rvuduc/cse6040-ipynbs/blob/master/13--pagerank-partial-solns.ipynb), but with solutions provided for Part 1 and partial solutions for Part 2.
In this notebook, you'll implement the [PageRank... | github_jupyter |
# Classifying Wines
<!-- PELICAN_BEGIN_SUMMARY -->
Let's kick off the blog with learning about wines, or rather training classifiers to learn wines for us ;)
In this post, we'll take a look at the [UCI Wine data](https://archive.ics.uci.edu/ml/datasets/wine), and then train several scikit-learn classifiers to predict... | github_jupyter |
Credits: Prof Bhiksha Raj
Course Homework for the course [11-785](https://deeplearning.cs.cmu.edu/) Introduction to Deep Learning, Spring 2020
You will write your own implementation of the backpropagation algorithm for training your own neural network, as
well as a few other features such as activation and loss funct... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cmx
import numpy as np
import os
```
<h3>Plot Target and Predictions
```
# open the target and pred textfiles
filepath_source = '/Users/robinson/Downloads/data/pred/20180628_151243/test_source.txt' # use... | github_jupyter |
# Image Classification Using Vision Transformer
Vision Transformer (ViT) is a new alternative to Convolution Neural Networks (CNNs) in the field of computer vision. The idea of [ViT](https://arxiv.org/abs/2010.11929) was inspired from the success of the [Transformer](https://arxiv.org/abs/1706.03762) and [BERT](https:... | github_jupyter |
# STELLARSTRUC.IPYNB -- Solve equations of stellar structure
```
### IMPORT STUFF ###
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from crust import crust
G = 6.674e-8 # Newton's constant in cgs units
c = 2.998e10 # speed of light in cm/... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.