Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Aug 7, 2023
1 parent 39e8972 commit f115eb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 229 deletions.
16 changes: 11 additions & 5 deletions docs/API/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ Image filtering
---------------------------------
.. currentmodule:: serket.nn

.. autoclass:: AdjustContrast2D
.. autoclass:: AvgBlur2D
.. autoclass:: GaussianBlur2D
.. autoclass:: Filter2D
.. autoclass:: FFTFilter2D

.. autoclass:: Filter2D
.. autoclass:: GaussianBlur2D
.. autoclass:: HistogramEqualization2D
.. autoclass:: HorizontalShear2D
.. autoclass:: Pixelate2D
.. autoclass:: PixelShuffle2D

.. autoclass:: AdjustContrast2D
.. autoclass:: RandomContrast2D
.. autoclass:: RandomHorizontalShear2D
.. autoclass:: RandomPerspective2D
.. autoclass:: RandomRotate2D
.. autoclass:: RandomVerticalShear2D
.. autoclass:: Rotate2D
.. autoclass:: VerticalShear2D
225 changes: 1 addition & 224 deletions docs/notebooks/layers_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,200 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# 📙 `serket.nn` layers overview\n",
"\n",
"\n",
"<table style=\"border:1px solid\">\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Linear](https://serket.readthedocs.io/en/latest/API/linear.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid border-color:red\">\n",
"\n",
"- `Linear`, `Multilinear`, `GeneralLinear`\n",
"- `Identity`\n",
"- `FNN`, `MLP`\n",
"- `Embedding`\n",
"\n",
"</td>\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Convolution](https://serket.readthedocs.io/en/latest/API/convolution.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `{Conv,FFTConv}{1D,2D,3D}`\n",
"- `{Conv,FFTConv}{1D,2D,3D}Transpose`\n",
"- `{Depthwise,Separable}{Conv,FFTConv}{1D,2D,3D}`\n",
"- `Conv{1D,2D,3D}Local`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Containers](https://serket.readthedocs.io/en/latest/API/containers.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `Sequential`, `RandomApply`\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Pooling](https://serket.readthedocs.io/en/latest/API/pooling.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `{Avg,Max,LP}Pool{1D,2D,3D}`\n",
"- `Global{Avg,Max}Pool{1D,2D,3D}`\n",
"- `Adaptive{Avg,Max}Pool{1D,2D,3D}`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Reshaping](https://serket.readthedocs.io/en/latest/API/reshaping.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `Flatten`, `Unflatten`\n",
"- `Repeat{1D,2D,3D}`\n",
"- `Resize{1D,2D,3D}`\n",
"- `Upsample{1D,2D,3D}`\n",
"- `Pad{1D,2D,3D}`\n",
"- `{Crop,RandomCrop}{1D,2D,3D}`\n",
"- `RandomZoom2D`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Normalization](https://serket.readthedocs.io/en/latest/API/normalization.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `{Layer,Instance,Group,Batch}Norm`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Image](https://serket.readthedocs.io/en/latest/API/image.html#)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `{Avg,Gaussian}Blur2D`\n",
"- `{Filter,FFTFilter}2D`\n",
"- `HistogramEqualization2D`\n",
"- `{Adjust,Random}Contrast2D`\n",
"- `PixelShuffle2D`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Dropout](https://serket.readthedocs.io/en/latest/API/dropout.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `Dropout`\n",
"- `Dropout{1D,2D,3D}`\n",
"- `RandomCutout{1D,2D}`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Activations](https://serket.readthedocs.io/en/latest/API/activations.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `Adaptive{LeakyReLU,ReLU,Sigmoid,Tanh}`\n",
"- `CeLU`,`ELU`,`GELU`,`GLU`\n",
"- `Hard{Shrink,Sigmoid,Swish,Tanh}`\n",
"- `Soft{Plus,Sign,Shrink}`\n",
"- `LeakyReLU`,`LogSigmoid`,`LogSoftmax`,`Mish`,`PReLU`\n",
"- `ReLU`,`ReLU6`,`SeLU`,`Sigmoid`\n",
"- `Swish`,`Tanh`,`TanhShrink`, `ThresholdedReLU`, `Snake`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"<tr>\n",
"\n",
"<td style=\"border:1px solid\" align=\"center\">\n",
"\n",
"[Recurrent](https://serket.readthedocs.io/en/latest/API/recurrent.html)\n",
"\n",
"</td>\n",
"\n",
"<td style=\"border:1px solid\">\n",
"\n",
"- `{Dense,SimpleRNN,LSTM,GRU}Cell`\n",
"- `{Conv,FFTConv}{LSTM,GRU}{1D,2D,3D}Cell`\n",
"- `ScanRNN`\n",
"\n",
"</td>\n",
"\n",
"</tr>\n",
"\n",
"</table>\n",
"\n",
"</details>"
"# 📙 `serket.nn` layers overview"
]
},
{
Expand Down Expand Up @@ -389,36 +196,6 @@
"linear\n",
"# note the dtype is f16(float16) in the repr output"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import serket as sk \n",
"import jax.numpy as jnp\n",
"\n",
"class MultiHeadDotProductAttention(sk.TreeClass):\n",
" def __init__(\n",
" self,\n",
" qkv_features:tuple[int,int,int],\n",
" out_features:int,\n",
" *,\n",
" num_heads:int,\n",
" q_weight_init,\n",
" q_bias_init,\n",
" k_weight_init,\n",
" k_bias_init,\n",
" v_weight_init,\n",
" v_bias_init,\n",
"\n",
" ):\n",
" \n",
"\n",
"\n",
" "
]
}
],
"metadata": {
Expand Down

0 comments on commit f115eb7

Please sign in to comment.