Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oml-npa/fluxextra.jl

Additional layers and functions for Flux.jl.
https://github.com/oml-npa/fluxextra.jl

flux julia-language machine-learning

Last synced: 5 days ago
JSON representation

Additional layers and functions for Flux.jl.

Awesome Lists containing this project

README

        

[![Docs dev](https://img.shields.io/badge/docs-stable-blue.svg)](https://oml-npa.github.io/FluxExtra.jl/stable/)
[![CI](https://github.com/OML-NPA/FluxExtra.jl/actions/workflows/CI-main.yml/badge.svg)](https://github.com/OML-NPA/FluxExtra.jl/actions/workflows/CI-main.yml)
[![codecov](https://codecov.io/gh/OML-NPA/FluxExtra.jl/branch/main/graph/badge.svg?token=JROBFGEVQN)](https://codecov.io/gh/OML-NPA/FluxExtra.jl)

# FluxExtra

Additional layers and functions for the [Flux.jl](https://github.com/FluxML/Flux.jl) machine learning library.

## Layers

### Join
```
Join(dim::Int64)
Join(dim = dim::Int64)
```
Concatenates a tuple of arrays along a dimension `dim`. A convenient and type stable way of using `x -> cat(x..., dims = dim)`.

### Split
```
Split(outputs::Int64,dim::Int64)
Split(outputs::Int64, dim = dim::Int64)
```
Breaks an array into a number of arrays which is equal to `output` along a dimension `dim`. `dim` should we divisible by `outputs` without a remainder.

### Flatten
```
Flatten()
```
Flattens an array. A convenient way of using `x -> Flux.flatten(x)`.

### Addition
```
Addition()
```
A convenient way of using `x -> sum(x)`.

### Activation
```
Activation(f::Function)
```
A convenient way of using `x -> f(x)`.

### Identity
```
Identity()
```
Returns its input without changes. Should be used with a `Parallel` layer if one wants to have a branch that does not change its input.

## Normalizations

### [0,1]
```
norm_01!(data::Vector{T}) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Rescales each feature (last dimension) to be in the range [0,1]. Returns min and max values for each feature.

```
norm_01!(data::T,min_vals::T,max_vals::T) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Rescales each feature (last dimension) to be in the range [0,1].

### [-1,1]
```
norm_negpos1(data::Vector{T}) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Rescales each feature (last dimension) to be in the range [-1,1]. Returns min and max values for each feature.

```
norm_negpos1(data::T,min_vals::T,max_vals::T) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Rescales each feature (last dimension) to be in the range [-1,1].

### Zero center
```
norm_zerocenter!(data::Vector{T}) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Subtracts the mean of each feature (last dimension). Returns a mean value for each feature.

```
norm_zerocenter!(data::T,min_vals::T,max_vals::T) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Subtracts the mean of each feature (last dimension).

### Z-score
```
norm_zscore!(data::Vector{T}) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Subtracts the mean and divides by the standard deviation of each feature (last dimension). Returns mean and standard deviation values for each feature.

```
norm_zscore!(data::T,mean_vals::T,std_vals::T) where {F<:AbstractFloat,N,T<:Array{F,N}}
```
Subtracts the mean and divides by the standard deviation of each feature (last dimension).

## Other

Makes `Flux.Parallel` layer type stable when used with tuples.