Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Lux.transform in favor of Flux2Lux.jl #170

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ jobs:
fail-fast: false
matrix:
group:
- Lux # Core Framework
- Boltz # Prebuilt Models using Lux
- LuxLib # Backend of Lux
- Lux # Core Framework
- Boltz # Prebuilt Models using Lux
- LuxLib # Backend of Lux
- Flux2Lux # Flux2Lux Converter
version:
- '1.6' # JET tests are disabled on 1.6
- '1.7'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/CINightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ jobs:
fail-fast: false
matrix:
group:
- Lux # Core Framework
- Boltz # Prebuilt Models using Lux
- LuxLib # Backend of Lux
- Lux # Core Framework
- Boltz # Prebuilt Models using Lux
- LuxLib # Backend of Lux
- Flux2Lux # Flux2Lux Converter
version:
- 'nightly' # merge even if tests fail
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=joinpath(pwd(), "lib/LuxLib"))); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=joinpath(pwd(), "lib/Flux2Lux"))); Pkg.develop(PackageSpec(path=joinpath(pwd(), "lib/LuxLib"))); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Install examples dependencies
run: julia --project=examples -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterMarkdown = "997ab1e6-3595-5248-9280-8efb232c3433"
Flux2Lux = "ab51a4a6-c8c3-4b1f-af31-4b52a21037df"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
LuxLib = "82251201-b29d-42c6-8e01-566dec8acb11"
Expand Down
5 changes: 3 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using Documenter, DocumenterMarkdown, Lux, LuxLib, Pkg
using Documenter, DocumenterMarkdown, Flux2Lux, Lux, LuxLib, Pkg

deployconfig = Documenter.auto_detect_deploy_system()
Documenter.post_status(deployconfig; type="pending", repo="github.com/avik-pal/Lux.jl.git")

makedocs(; sitename="Lux", authors="Avik Pal et al.", clean=true, doctest=true,
modules=[Lux, LuxLib], strict=[
modules=[Flux2Lux, Lux, LuxLib],
strict=[
:doctest,
:linkcheck,
:parse_error,
Expand Down
3 changes: 3 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ nav:
- "Frameworks":
- "Boltz": "lib/Boltz/index.md"
- "FluxMPI": "https://avik-pal.github.io/FluxMPI.jl/dev/"
- "Flux2Lux":
- "Introduction": "lib/Flux2Lux/index.md"
- "API Reference": "lib/Flux2Lux/api.md"
- "NNlib": "https://fluxml.ai/Flux.jl/stable/models/nnlib/"
- "LuxLib":
- "Introduction": "lib/LuxLib/index.md"
Expand Down
21 changes: 21 additions & 0 deletions docs/src/lib/Flux2Lux/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```@meta
CurrentModule = Flux2Lux
```

## Functions

```@docs
transform
```

## Layers

```@docs
FluxLayer
```

## Index

```@index
Pages = ["api.md"]
```
22 changes: 22 additions & 0 deletions docs/src/lib/Flux2Lux/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Flux2Lux

[![Join the chat at https://julialang.zulipchat.com #machine-learning](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/machine-learning)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://lux.csail.mit.edu/dev/lib/Flux2Lux/)
[![Stable Docs](https://img.shields.io/badge/docs-stable-blue.svg)](http://lux.csail.mit.edu/stable/lib/Flux2Lux/)

[![CI](https://github.com/avik-pal/Lux.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/avik-pal/Lux.jl/actions/workflows/CI.yml)
[![CI Nightly](https://github.com/avik-pal/Lux.jl/actions/workflows/CINightly.yml/badge.svg)](https://github.com/avik-pal/Lux.jl/actions/workflows/CINightly.yml)
[![codecov](https://codecov.io/gh/avik-pal/Lux.jl/branch/main/graph/badge.svg?token=IMqBM1e3hz)](https://codecov.io/gh/avik-pal/Lux.jl)
[![Package Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Flux2Lux)](https://pkgs.genieframework.com?packages=Flux2Lux)

[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)

Flux2Lux is a package that allows you to convert Flux.jl models to Lux.jl.

## Difference from `Lux.transform`

`Lux.transform` has been deprecated in favor of `Flux2Lux.jl`. This package is a strict
superset of its predecessor. It provides additional features like `preserve_ps_st` and
`force_transform`. See the documentation of `Flux2Lux.transform` for more details.
21 changes: 21 additions & 0 deletions lib/Flux2Lux/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Avik Pal <[email protected]> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 16 additions & 0 deletions lib/Flux2Lux/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "Flux2Lux"
uuid = "ab51a4a6-c8c3-4b1f-af31-4b52a21037df"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "0.1.0"

[deps]
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
Flux = "0.13"
Lux = "0.4.26"
Optimisers = "0.2"
julia = "1.6"
22 changes: 22 additions & 0 deletions lib/Flux2Lux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Flux2Lux

[![Join the chat at https://julialang.zulipchat.com #machine-learning](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/machine-learning)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://lux.csail.mit.edu/dev/lib/Flux2Lux/)
[![Stable Docs](https://img.shields.io/badge/docs-stable-blue.svg)](http://lux.csail.mit.edu/stable/lib/Flux2Lux/)

[![CI](https://github.com/avik-pal/Lux.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/avik-pal/Lux.jl/actions/workflows/CI.yml)
[![CI Nightly](https://github.com/avik-pal/Lux.jl/actions/workflows/CINightly.yml/badge.svg)](https://github.com/avik-pal/Lux.jl/actions/workflows/CINightly.yml)
[![codecov](https://codecov.io/gh/avik-pal/Lux.jl/branch/main/graph/badge.svg?token=IMqBM1e3hz)](https://codecov.io/gh/avik-pal/Lux.jl)
[![Package Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Flux2Lux)](https://pkgs.genieframework.com?packages=Flux2Lux)

[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)

Flux2Lux is a package that allows you to convert Flux.jl models to Lux.jl.

## Difference from `Lux.transform`

`Lux.transform` has been deprecated in favor of `Flux2Lux.jl`. This package is a strict
superset of its predecessor. It provides additional features like `preserve_ps_st` and
`force_transform`. See the documentation of `Flux2Lux.transform` for more details.
Loading