<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Playing with the PyGSP\n",
    "<https://github.com/epfl-lts2/pygsp>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from pygsp import graphs, filters\n",
    "\n",
    "plt.rcParams['figure.figsize'] = (17, 5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1 Example\n",
    "\n",
    "The following demonstrates how to instantiate a graph and a filter, the two main objects of the package."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "G = graphs.Logo()\n",
    "G.estimate_lmax()\n",
    "g = filters.Heat(G, tau=100)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's now create a graph signal: a set of three Kronecker deltas for that example. We can now look at one step of heat diffusion by filtering the deltas with the above defined filter. Note how the diffusion follows the local structure!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "DELTAS = [20, 30, 1090]\n",
    "s = np.zeros(G.N)\n",
    "s[DELTAS] = 1\n",
    "s = g.filter(s)\n",
    "G.plot_signal(s, highlight=DELTAS, backend='matplotlib')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2 Tutorials\n",
    "\n",
    "Try to follow one of our [tutorials](https://pygsp.readthedocs.io/en/stable/tutorials/index.html)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Your code here."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3 Playground\n",<commit_msg>playground: link to NTDS GSP demo<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Playing with the PyGSP\n",
    "<https://github.com/epfl-lts2/pygsp>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from pygsp import graphs, filters\n",
    "\n",
    "plt.rcParams['figure.figsize'] = (17, 5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1 Example\n",
    "\n",
    "The following demonstrates how to instantiate a graph and a filter, the two main objects of the package."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "G = graphs.Logo()\n",
    "G.estimate_lmax()\n",
    "g = filters.Heat(G, tau=100)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's now create a graph signal: a set of three Kronecker deltas for that example. We can now look at one step of heat diffusion by filtering the deltas with the above defined filter. Note how the diffusion follows the local structure!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "DELTAS = [20, 30, 1090]\n",
    "s = np.zeros(G.N)\n",
    "s[DELTAS] = 1\n",
    "s = g.filter(s)\n",
    "G.plot_signal(s, highlight=DELTAS, backend='matplotlib')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2 Tutorials\n",
    "\n",
    "Try to follow one of our [tutorials](https://pygsp.readthedocs.io/en/stable/tutorials/index.html), or go through my [computational introduction to GSP in NTDS'17](https://mybinder.org/v2/gh/mdeff/ntds_2017/outputs?urlpath=notebooks/demos/08_pygsp.ipynb)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Your code here."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3 Playground\n",
{'fraction_non_alphanumeric': 0.1990896022999521, 'fraction_numerical': 0.011260182079540009, 'mean_word_length': 2.7243532560214097, 'pattern_counts': {'":': 72, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 5, '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}}
{'dir': 'git-commits-cleaned', 'id': '2308011', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1576, 'n_words': 358}