{"id":17143842,"url":"https://github.com/asem000/serket","last_synced_at":"2025-10-07T01:52:53.745Z","repository":{"id":59659570,"uuid":"526985786","full_name":"ASEM000/serket","owner":"ASEM000","description":"The ✨Magical✨ JAX ML Library.","archived":false,"fork":false,"pushed_at":"2025-01-25T18:53:51.000Z","size":48512,"stargazers_count":17,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T11:11:52.879Z","etag":null,"topics":["jax","machine-learning","neural-network"],"latest_commit_sha":null,"homepage":"https://serket.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ASEM000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-20T16:50:45.000Z","updated_at":"2025-01-25T18:53:50.000Z","dependencies_parsed_at":"2024-04-13T12:39:54.106Z","dependency_job_id":null,"html_url":"https://github.com/ASEM000/serket","commit_stats":{"total_commits":76,"total_committers":2,"mean_commits":38.0,"dds":0.03947368421052633,"last_synced_commit":"eb20f6d14b22d85ffe8e843b99a2e8c50ac70ac7"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ASEM000/serket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASEM000%2Fserket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASEM000%2Fserket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASEM000%2Fserket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASEM000%2Fserket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ASEM000","download_url":"https://codeload.github.com/ASEM000/serket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASEM000%2Fserket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278708030,"owners_count":26031932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jax","machine-learning","neural-network"],"created_at":"2024-10-14T20:42:26.650Z","updated_at":"2025-10-07T01:52:53.730Z","avatar_url":"https://github.com/ASEM000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg width=\"150px\" src=https://github.com/ASEM000/serket/assets/48389287/1ea9efd6-d848-48dc-9342-4198a9d9a90c\u003e\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eThe ✨Magical✨ JAX ML Library.\u003c/h2\u003e\n\u003ch5 align = \"center\"\u003e *Serket is the goddess of magic in Egyptian mythology\n\n[**Installation**](#Installation)\n|[**Description**](#Description)\n|[**Documentation**](#Documentation)\n|[**Quick Example**](#QuickExample)\n\n![Tests](https://github.com/ASEM000/serket/actions/workflows/tests.yml/badge.svg)\n![pyver](https://img.shields.io/badge/python-3.10%203.11%203.12%203.13-blue)\n![codestyle](https://img.shields.io/badge/codestyle-black-black)\n[![codecov](https://codecov.io/gh/ASEM000/serket/branch/main/graph/badge.svg?token=C6NXOK9EVS)](https://codecov.io/gh/ASEM000/serket)\n[![Documentation Status](https://readthedocs.org/projects/serket/badge/?version=latest)](https://serket.readthedocs.io/?badge=latest)\n[![DOI](https://zenodo.org/badge/526985786.svg)](https://zenodo.org/badge/latestdoi/526985786)\n[![CodeFactor](https://www.codefactor.io/repository/github/asem000/serket/badge)](https://www.codefactor.io/repository/github/asem000/serket)\n\n\u003c/h5\u003e\n\n## 🛠️ Installation\u003ca id=\"Installation\"\u003e\u003c/a\u003e\n\n**Install development version**\n\n```python\npip install git+https://github.com/ASEM000/serket\n```\n\n## 📖 Description and motivation\u003ca id=\"Description\"\u003e\u003c/a\u003e\n\n- `serket` aims to be the most intuitive and easy-to-use machine learning library in `jax`.\n- `serket` is fully transparent to `jax` transformation (e.g. `vmap`,`grad`,`jit`,...).\n\n## 📙 Documentation \u003ca id=\"Documentation\"\u003e\u003c/a\u003e\n- [Full documentation](https://serket.readthedocs.io/)\n- [Train MNIST, UNet, ConvLSTM, PINN](https://serket.readthedocs.io/training_guides.html)\n- [Model surgery, Parallelism, Mixed precision](https://serket.readthedocs.io/core_guides.html)\n- [Optimizers, Augmentation composition](https://serket.readthedocs.io/other_guides.html)\n- [Interoperability with keras, tensorflow](https://serket.readthedocs.io/interoperability.html)\n\n\n## 🏃 Quick example\u003ca id=\"QuickExample\"\u003e\u003c/a\u003e\n\n```python\nimport jax, jax.numpy as jnp\nimport serket as sk\n\nx_train, y_train = ..., ...\nk1, k2 = jax.random.split(jax.random.key(0))\n\nnet = sk.tree_mask(sk.Sequential(\n    jnp.ravel,\n    sk.nn.Linear(28 * 28, 64, key=k1),\n    jax.nn.relu,\n    sk.nn.Linear(64, 10, key=k2),\n))\n\n@ft.partial(jax.grad, has_aux=True)\ndef loss_func(net, x, y):\n    logits = jax.vmap(sk.tree_unmask(net))(x)\n    onehot = jax.nn.one_hot(y, 10)\n    loss = jnp.mean(softmax_cross_entropy(logits, onehot))\n    return loss, (loss, logits)\n\n@jax.jit\ndef train_step(net, x, y):\n    grads, (loss, logits) = loss_func(net, x, y)\n    net = jax.tree_map(lambda p, g: p - g * 1e-3, net, grads)\n    return net, (loss, logits)\n\nfor j, (xb, yb) in enumerate(zip(x_train, y_train)):\n    net, (loss, logits) = train_step(net, xb, yb)\n    accuracy = accuracy_func(logits, y_train)\n\nnet = sk.tree_unmask(net)\n```\n\n\u003cdetails\u003e \u003csummary\u003e 📚 Layers catalog \u003c/summary\u003e\n\n#### 🔗 Common API\n\n| Group      | Layers                           |\n| ---------- | -------------------------------- |\n| Containers | - `Sequential`, `Random{Choice}` |\n\n#### 🧠 Neural network package: `serket.nn`\n\n| Group             | Layers                                                                                                                                                                                                                                                                                                                    |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Attention         | - `MultiHeadAttention`                                                                                                                                                                                                                                                                                                    |\n| Convolution       | - `{FFT,_}Conv{1D,2D,3D}` \u003cbr\u003e - `{FFT,_}Conv{1D,2D,3D}Transpose` \u003cbr\u003e - `Depthwise{FFT,_}Conv{1D,2D,3D}` \u003cbr\u003e - `Separable{FFT,_}Conv{1D,2D,3D}` \u003cbr\u003e - `Conv{1D,2D,3D}Local` \u003cbr\u003e - `SpectralConv{1D,2D,3D}`                                                                                                            |\n| Dropout           | - `Dropout`\u003cbr\u003e - `Dropout{1D,2D,3D}` \u003cbr\u003e - `RandomCutout{1D,2D,3D}`                                                                                                                                                                                                                                                     |\n| Linear            | - `Linear`, `MLP`, `Identity`                                                                                                                                                                                                                                                                                   |                                                                                                                                                                                                                                                            |\n| Normalization     | - `{Layer,Instance,Group,Batch}Norm`                                                                                                                                                                                                                                                                                      |\n| Pooling           | - `{Avg,Max,LP}Pool{1D,2D,3D}` \u003cbr\u003e - `Global{Avg,Max}Pool{1D,2D,3D}` \u003cbr\u003e - `Adaptive{Avg,Max}Pool{1D,2D,3D}`                                                                                                                                                                                                            |\n| Reshaping         | - `Upsample{1D,2D,3D}` \u003cbr\u003e - `{Random,Center}Crop{1D,2D,3D}` `                                                                                                                                                                                                                                                           |\n| Recurrent cells   | - `{SimpleRNN,LSTM,GRU,Dense}Cell` \u003cbr\u003e - `{Conv,FFTConv}{LSTM,GRU}{1D,2D,3D}Cell`                                                                                                                                                                                                                                        |\n| Activations       | - `Adaptive{LeakyReLU,ReLU,Sigmoid,Tanh}`,\u003cbr\u003e - `CeLU`,`ELU`,`GELU`,`GLU`\u003cbr\u003e- `Hard{SILU,Shrink,Sigmoid,Swish,Tanh}`, \u003cbr\u003e - `Soft{Plus,Sign,Shrink}` \u003cbr\u003e - `LeakyReLU`,`LogSigmoid`,`LogSoftmax`,`Mish`,`PReLU`,\u003cbr\u003e - `ReLU`,`ReLU6`,`SeLU`,`Sigmoid` \u003cbr\u003e - `Swish`,`Tanh`,`TanhShrink`, `ThresholdedReLU`, `Snake` |\n\n#### 🖼️ Image package: `serket.image`\n\n| Group     | Layers                                                                                                                                                                                                           |\n| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Filter    | - `{FFT,_}{Avg,Box,Gaussian,Motion}Blur2D` \u003cbr\u003e - `{JointBilateral,Bilateral,Median}Blur2D` \u003cbr\u003e - `{FFT,_}{UnsharpMask}2D` \u003cbr\u003e - `{FFT,_}{Sobel,Laplacian}2D` \u003cbr\u003e - `{FFT,_}BlurPool2D`                       |\n| Augment   | - `Adjust{Sigmoid,Log}2D` \u003cbr\u003e - `{Adjust,Random}{Brightness,Contrast,Hue,Saturation}2D`, \u003cbr\u003e - `RandomJigSaw2D`,`PixelShuffle2D`, \u003cbr\u003e - `Pixelate2D`,`Posterize2D`,`Solarize2D` \u003cbr\u003e - `FourierDomainAdapt2D` |\n| Geometric | - `{Random,_}{Horizontal,Vertical}{Translate,Flip,Shear}2D` \u003cbr\u003e - `{Random,_}{Rotate}2D` \u003cbr\u003e - `RandomPerspective2D` \u003cbr\u003e - `{FFT,_}ElasticTransform2D`                     |\n| Color     | - `RGBToGrayscale2D` , `GrayscaleToRGB2D` \u003cbr\u003e - `RGBToHSV2D`, `HSVToRGB2D`                                                                                                                                      |\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasem000%2Fserket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasem000%2Fserket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasem000%2Fserket/lists"}