Skip to content

Instantly share code, notes, and snippets.

@daxiongshu
Last active June 13, 2021 13:43
Show Gist options
  • Save daxiongshu/e1a1aba2d2a31b438561ed1333543ac7 to your computer and use it in GitHub Desktop.
Save daxiongshu/e1a1aba2d2a31b438561ed1333543ac7 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
"import cupy as cp\n",
"from cupyx.scipy.special import erfinv\n",
"import cudf as gd\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"from scipy.special import erfinv as sp_erfinv"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### GaussRank transformation"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"x_gpu = cp.random.rand(20) # input array\n",
"x_cpu = cp.asnumpy(x_gpu)\n",
"\n",
"r_gpu = x_gpu.argsort().argsort() # compute the rank\n",
"r_cpu = x_cpu.argsort().argsort() \n",
"\n",
"r_gpu = (r_gpu/r_gpu.max()-0.5)*2 # scale to (-1,1)\n",
"epsilon = 1e-6\n",
"r_gpu = cp.clip(r_gpu,-1+epsilon,1-epsilon)\n",
"\n",
"r_cpu = (r_cpu/r_cpu.max()-0.5)*2 # scale to (-1,1)\n",
"r_cpu = cp.clip(r_cpu,-1+epsilon,1-epsilon)\n",
"\n",
"r_gpu = erfinv(r_gpu) # map to gaussian\n",
"r_cpu = sp_erfinv(r_cpu) # map to gaussian"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Inverse transformation step by step"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"df_cpu = pd.DataFrame({'src':x_cpu,'tgt':r_cpu}) \n",
"df_gpu = gd.DataFrame({'src':x_gpu,'tgt':r_gpu}) # pass cupy array to cudf dataframe\n",
"\n",
"df_cpu = df_cpu.sort_values('src') # sort\n",
"df_gpu = df_gpu.sort_values('src')\n",
"\n",
"pos_cpu = df_cpu['tgt'].searchsorted(r_cpu, side='left') # search\n",
"pos_gpu = df_gpu['tgt'].searchsorted(r_gpu, side='left')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def linear_inter_polate(df,x,pos):\n",
" N = df.shape[0]\n",
" pos[pos>=N] = N-1\n",
" pos[pos-1<=0] = 0\n",
" if isinstance(x,cp.ndarray):\n",
" pos = pos.values\n",
" \n",
" x1 = df['tgt'].values[pos]\n",
" x2 = df['tgt'].values[pos-1]\n",
" y1 = df['src'].values[pos]\n",
" y2 = df['src'].values[pos-1]\n",
"\n",
" relative = (x-x2) / (x1-x2)\n",
" return (1-relative)*y2 + relative*y1"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"x_inv_cpu = linear_inter_polate(df_cpu,r_cpu,pos_cpu) # linear inter polate\n",
"x_inv_gpu = linear_inter_polate(df_gpu,r_gpu,pos_gpu)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GaussRank CPU\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABDAAAAFgCAYAAABNIolGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3debhkZ10n8O+PNDthcdLGQNJ00IBi9AFsA8oMWxAjQSIDChlhDKIZRFYRjDBDkOgYFnGDGYyQCWBki8QBg0JEehiQBDoQIBsQQoBAIGHCEkggRN7545xLqu/S9/Zdqt7u/nyep56uc+rUOb96+9633vut95yq1loAAAAAenazWRcAAAAAsBwBBgAAANA9AQYAAADQPQEG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1yXZInzqbSmTm5qu6R5HtJPpvkyTOuZyVekeSWSc4e3wPOaa11W3dVPSrJXybZnOSsqjq/tfbzMy5rJ0v1HzMua0mL/V631l4z26p26f5JnpDk4+M1JZLkea21d8ywpuUclOS1VbVfhg/Z3txa+4cZ17TXMe5dyLh3IePehYx7FzftcW/t5e0JAAAA7AWcQgIAAAB0T4ABAAAAdE+AAQAAAHRPgAEAAAB0T4ABAAAAdE+AAQAAAHRPgAEAAAB07/8DX9yuDwsAqkUAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 1080x360 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"n_bins = 5\n",
"fig, axs = plt.subplots(1, 3, sharey=True, tight_layout=True)\n",
"fig.set_figheight(5)\n",
"fig.set_figwidth(15)\n",
"axs[0].hist(x_cpu, bins=n_bins)\n",
"axs[0].set_title('input',fontsize=15)\n",
"axs[1].hist(r_cpu, bins=n_bins)\n",
"axs[1].set_title('transform',fontsize=15)\n",
"_ = axs[2].hist(x_inv_cpu, bins=n_bins)\n",
"axs[2].set_title('inverse transform',fontsize=15)\n",
"print('GaussRank CPU')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GaussRank GPU\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABDAAAAFgCAYAAABNIolGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3debhkZ10n8O+PNDthcdLGQNJ00IBi9AFsA8oMWxAjQSIDChlhDKIZRFYRjDBDkOgYFnGDGYyQCWBki8QBg0JEehiQBDoQIBsQQoBAIGHCEkggRN7545xLqu/S9/Zdqt7u/nyep56uc+rUOb96+9633v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Y6rodPrzdSVb0hwxv6AeM5kCdmuBhdWmuvyjDj4OFJLk1yXZInzqbSmTm5qu6R5HtJPpvkyTOuZyVekeSWSc4e3wPOaa11W3dVPSrJXybZnOSsqjq/tfbzMy5rJ0v1HzMua0mL/V631l4z26p26f5JnpDk4+M1JZLkea21d8ywpuUclOS1VbVfhg/Z3txa+4cZ17TXMe5dyLh3IePehYx7FzftcW/t5e0JAAAA7AWcQgIAAAB0T4ABAAAAdE+AAQAAAHRPgAEAAAB0T4ABAAAAdE+AAQAAAHRPgAEAAAB07/8DX9yuDwsAqkUAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 1080x360 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"n_bins = 5\n",
"fig, axs = plt.subplots(1, 3, sharey=True, tight_layout=True)\n",
"fig.set_figheight(5)\n",
"fig.set_figwidth(15)\n",
"axs[0].hist(cp.asnumpy(x_gpu), bins=n_bins)\n",
"axs[0].set_title('input',fontsize=15)\n",
"axs[1].hist(cp.asnumpy(r_gpu), bins=n_bins)\n",
"axs[1].set_title('transform',fontsize=15)\n",
"_ = axs[2].hist(cp.asnumpy(x_inv_gpu), bins=n_bins)\n",
"axs[2].set_title('inverse transform',fontsize=15)\n",
"print('GaussRank GPU')"
]
}
],
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment