CS224W - Colab 0
CS224W - Colab 0
Colab 0 will not be graded, so you don’t need to hand in this notebook. That said, we highly recommend you to run this notebook, so you can get familiar with the basic concepts of graph mining and Graph Neural Networks.
In this Colab, we will introduce two packages, NetworkX and PyTorch Geometric.
For the PyTorch Geometric section, you don’t need to understand all the details already. Concepts and implementations of graph neural network will be covered in future lectures and Col ...
Node2Vec 官方代码解读
Node2Vec 官方代码解读
参考资料
Node2Vec 官方作者 Aditya Grover 代码:https://github.com/aditya-grover/node2vec
1. 环境准备
工具包
1234567891011import warningswarnings.filterwarnings('ignore')import argparseimport numpy as npimport networkx as nx from gensim.models import Word2Vecimport randomimport matplotlib.pyplot as plt %matplotlib inline
读入命令行参数
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950def parse_args(): ''' Parses the node2vec argume ...
Node2Vec 图嵌入:《悲惨世界》人物关系
Node2Vec 图嵌入: 《悲惨世界》人物关系
参考资料:
Elior Cohen 代码:https://github.com/eliorc/node2vec
Elior Cohen 博客:https://maelfabien.github.io/machinelearning/graph_5/
1. 环境准备
安装工具包
1!pip install node2vec networkx numpy matplotlib
导入工具包
123456789101112# 图数据挖掘import networkx as nx# 数据分析import numpy as np# 随机数import random# 数据可视化import matplotlib.pyplot as plt
2. 数据
初始化
12345# 空手道俱乐部# G = nx.karate_club_graph()# 悲惨世界 人物G = nx.les_miserables_graph()
1G.nodes
NodeView(('Napoleon', 'Myriel', 'MlleBaptistine', 'MmeMa ...
DeepWalk 图嵌入:维基百科词条
DeepWalk 图嵌入:维基百科词条
1. 环境参考
参考资料
https://github.com/prateekjoshi565/DeepWalk
安装工具包
1!pip install networkx gensim pandas numpy tqdm scikit-learn matplotlib
导入工具包
123456789101112131415# 图数据挖掘import networkx as nx# 数据分析import pandas as pdimport numpy as np# 随机数与进度条import randomfrom tqdm import tqdm# 数据可视化import matplotlib.pyplot as plt%matplotlib inline
2. 数据
获取数据
爬虫网站:https://densitydesign.github.io/strumentalia-seealsology/
设置 distance
输入链接:
https://en.wikipedia.org/wiki/Computer_vision
htt ...
ML2021 - HW 5
Homework 5 - Sequence-to-sequence
If you have any questions, feel free to email us at: ntu-ml-2021spring-ta@googlegroups.com
(4/21 Updates)
Link to reference training curves.
(4/14 Updates)
Link to tutorial video part 1 part 2.
Now defaults to load "avg_last_5_checkpoint.pt" to generate prediction.
Expected run time on Colab with Tesla T4
Baseline
Details
Total Time
Simple
2m 15s $\times$30 epochs
1hr 8m
Medium
4m $\times$30 epochs
2hr
Strong
8m $\times$30 epochs (backwa ...
ML2021 - HW 4
HW4: Speaker Prediction
goal: learn to use transformer
赛事:https://www.kaggle.com/competitions/ml2021spring-hw4/overview
Baselines:
Easy: Run sample code and know how to use transformer.
Medium: Know how to adjust parameters of transformer.
Hard: Construct conformer which is a variety of transformer.
Other links
Kaggle: link
Slide: link
Data: link
Video (Chinese): link
Video (English): link
Solution for downloading dataset fail.: link
1. Data
Dataset
12345678910111213141516171819202 ...
ML2021 - HW 3
HW3 : Convolutional Nueral Network
In this homework, you are required to build a convolutional neural network for image classification, possibly with some advanced training tips.
There are three levels here:
Easy: Build a simple convolutional neural network as the baseline. (2 pts)
Medium: Design a better architecture or adopt different data augmentations to improve the performance. (2 pts)
Hard: Utilize provided unlabeled data to obtain better results. (2 pts)
https://www.kaggle.com/competitio ...
ML2021 - HW 2
HW2: Phoneme Classification
Platform : Kaggle
Sample Code : Google Colab
0. Prepare
TIMIT
This homework is a multiclass classification task, we are going to train a deep neural network classifier to predict the phonemes for each frame from the speech corpus TIMIT.
Google Colab 下载:(或官网下载也行)
123!gdown --id '1HPkcmQmFGu-3OknddKIa5dNDsR05lIQR' --output data.zip!unzip data.zip!ls
zsh:1: command not found: gdown
unzip: cannot find or open data.zip, data.zip.zip or data.zip.ZIP.
HW02.pdf ...
ML2021 - HW 1
HW1: COVID-19 Cases Prediction (Regression)
Platform : Kaggle
Sample Code : Google Colab
Objectives:
Solve a regression problem with deep neural network. (DNN)
Understand basic DNN training tips.
Get familiar with PyTorch.
0. Prepare
12import warningswarnings.filterwarnings('ignore')
预览数据
12tr_path = 'input/covid.train.csv'tt_path = 'input/covid.test.csv'
123456# 预览数据import pandas as pddata = pd.read_csv(tr_path)print("Shape:",data.shape)data.iloc[:,4 ...
INTRO to DL - Kaggle 官方课程
来源:Kaggle 官方课程 Intro to Deep Learning
2024-09-01@isSeymour
Intro to Deep Learning
Exercise: Binary Classification
1.导入数据
123456789101112import pandas as pdimport matplotlib.pyplot as pltfrom sklearn.model_selection import train_test_splitfrom sklearn.preprocessing import StandardScaler, OneHotEncoderfrom sklearn.impute import SimpleImputerfrom sklearn.pipeline import make_pipelinefrom sklearn.compose import make_column_transformerhotel = pd.read_csv('../input/hotel.csv')print(" ...