<jupyter_start><jupyter_text><jupyter_code>!pip install --upgrade tensorflow==1.14.0
import tensorflow
tensorflow.__version__
#Used the implementation of original paper, fixed absolute path
!git clone https://github.com/trishac97/pygcn.git
!rm -rf pygcn/
cd pygcn/
#(1.1) Run GCN on the Cora dataset and show your results, including accuracy and runtime. 
%run pygcn/train.py
#(1.2) Replace the normalization with symmetric normalization and redo (1)
# Add adj = normalize_adj(adj) line 40 utils.py

%run pygcn/train.py

#Observation: Accuracy decreases from (1.1)
# (1.3) Compare the runtimes of (1) with and without GPU support.
%run pygcn/train.py
#Observation : Accuracy changed slightly from (1). Time elapsed decreased from (1)
#(1.4) For the train/val/test dataset, use a random split of 70%/10%/20% instead of the original split, and redo (1)
    # idx_train = range(1050)
    # idx_val = range(1050, 1200)
    # idx_test = range(1200, 1500)
%run pygcn/train.py
#Observation : Accuracy increased from 1.1
#(1.5) Increase the number of layers in GCN and test their performance with 3, 4, 5, 10 and 15 layers.
#3-layers
%run pygcn/train.py
#4-layers
%run pygcn/train.py
#5-layers
%run pygcn/train.py
#10-layers
%run pygcn/train.py
#15-layers
%run pygcn/train.py
#        self.gc14 = GraphConvolution(nhid, nhid) #Middle Layer
#       x = F.relu(self.gc5(x, adj)) #???


#(1.6) Based on DeepGCN, replace GC layer with residual learning layer. Compare the performance with (1.5)
#  def forward(self, x, adj):
#         x = F.relu(self.gc1(x, adj))
#         i = x
#         x = F.dropout(x, self.dropout, training=self.training)
#         x = i+x
#         x = self.gc2(x, adj)

#         return F.log_softmax(x, dim=1)
%run pygcn/train.py
#Observation: Accuracy marely increases using residual layer. Doesn't help oversmoothing problem. Although one residual layer is better that 1 GCN middle layer.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11633919338159256, 'fraction_numerical': 0.04033092037228542, 'mean_word_length': 3.7777777777777777, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '283196', 'license': 'MIT', 'n_tokens_mistral': 738, 'n_tokens_neox': 678, 'n_words': 226, 'path': 'Pygcn.ipynb', 'repo_name': 'trishac97/PYGCN-GML-HW2', 'size': '1934'}