Parrot

A neural network framework for emulating stellar population synthesis. Written in Julia.

Installation

First, please install Julia on your system by following the steps listed on the Julia website. This package is currently being developed and tested on Julia v1.6.

To install Parrot, open a Julia REPL and type ] (to enter the Pkg REPL) followed by:

(@v1.6) pkg> add https://github.com/elijahmathews/Parrot.jl.git

Or alternatively, run the following code directly at the Julia REPL:

julia> import Pkg; Pkg.add(url="https://github.com/elijahmathews/Parrot.jl.git")

Overview

At the moment, Parrot is in development, but the intent is to create a package that will aid in emulating stellar population synthesis (SPS) codes efficiently using neural networks. The package is currently being designed under the Flux machine learning ecosystem, and may be combined with Turing probabilistic programming library for SED inference.

Parrot.AlsingType
Alsing(in::Integer, out::Integer)

Create a non-linear Alsing layer with trainable parameters W, b, α, and β.

y = (β .+ σ.(α .* (W*x .+ b)) .* (1 .- β)) .* (W*x .+ b)

The input x must be a vector of length in, or a batch of vectors represented as an in × N matrix. The out y will be a vector or batch of length out.

See Alsing et al. (2020) for more information about this activation function. Intended to be used for emulating stellar population synthesis codes.

Example

julia> a = Alsing(8, 3)
Alsing(8, 3)

julia> a(rand(8))
3-element Array{Float32,1}:
 0.9413336
 0.30788675
 0.5125884
source
Parrot.TransformPCAType
TransformPCA(P::MultivariateStats.PCA{AbstractFloat})
TransformPCA(P::OnlineStats.CCIPCA)

Create a TransformPCA layer that uses Principal Component Analysis (PCA) to transform its input into the PCA basis using a given PCA object P.

The input x must have dimensions compatible with P and the layer's output will be of the dimensions given by the PCA transformation. No parameters are trainable.

See also: ReconstructPCA

source
Parrot.ReconstructPCAType
ReconstructPCA(P::MultivariateStats.PCA{AbstractFloat})
ReconstructPCA(P::OnlineStats.CCIPCA)

Create a ReconstructPCA layer that uses Principal Component Analysis (PCA) to reconstruct its input from the PCA basis using a given PCA object P.

The input x must have dimensions compatible with P and the layer's output will be of the dimensions given by the PCA reconstruction. No parameters are trainable.

See also: TransformPCA

source
Parrot.NormalizeType
Normalize(μ::AbstractArray, σ::AbstractArray)

Create a simple Normalize layer with parameters consisting of some previously known mean μ and standard deviation σ that are used to normalize its input.

y = (x .- μ) ./ σ

The input x must be a vector of equal length to both μ and σ or an array with dimensions such that the broadcasted functions can be used with the given μ and σ. No parameters are trainable.

See also: Denormalize

source
Parrot.DenormalizeType
Denormalize(μ::AbstractArray, σ::AbstractArray)

Create a simple Denormalize layer with parameters consisting of some previously known mean μ and standard deviation σ that are used to restore its input from a normalized state.

y = (σ .* x) .+ μ

The input x must be a vector of equal length to both μ and σ or an array with dimensions such that the broadcasted functions can be used with the given μ and σ. No parameters are trainable.

See also: Normalize

source