{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from sparse_smoothing.utils import load_and_standardize\n",
    "import torch\n",
    "from gust.io import save_to_npz, load_from_npz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = np.load('/home/jan/Programming/uni/collective_cert_prep/data/graphs/cora_ml.npz', allow_pickle=True)\n",
    "adj = x['adj'][()]\n",
    "attr = x['attr'][()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "save_to_npz('/home/jan/Downloads/cora_ml_collective.npz', load_and_standardize('cora_ml'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8089990"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['adj_matrix.data',\n",
       " 'adj_matrix.indices',\n",
       " 'adj_matrix.indptr',\n",
       " 'adj_matrix.shape',\n",
       " 'attr_matrix.data',\n",
       " 'attr_matrix.indices',\n",
       " 'attr_matrix.indptr',\n",
       " 'attr_matrix.shape',\n",
       " 'edge_attr_matrix',\n",
       " 'labels',\n",
       " 'node_names',\n",
       " 'attr_names',\n",
       " 'edge_attr_names',\n",
       " 'class_names',\n",
       " 'metadata',\n",
       " 'type']"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(np.load('/home/jan/Downloads/cora_ml.npz').keys())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = load_from_npz('/home/jan/Downloads/cora_ml_collective.npz')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7896100"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7896100"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
