Giter Club home page Giter Club logo

chainplots.jl's Introduction

👋

Hi, there, welcome to my github page!

I am a Mathematician, working at the Universidade Federal do Rio de Janeiro, Brazil, with a PhD degree in Applied Mathematics from the Indiana University, from 1996. I have a diverse range of interest in Mathematics, both pure and applied, with most of the topics involving some sort of differential equation, with past and present projects in the Oil & Field industry and with financial organizations. I have a number of publications totaling 1000+ citations, including the book Navier-Stokes Equations and Turbulence, co-authored with Ciprian Foias, Oscar P. Manley, and Roger Temam.

In education, I like making most of my textbooks freely available, although mostly in Portuguese. Here are some: Random notes (Bayesian probabilistic programing), Equações diferenciais (pdf), Modelagem Matemática, Aspectos teóricos e numéricos de equações diferenciais estocásticas (SDE) e aleatórias (RODE), Tutorial Flux.

Lately I have been enjoying doing numerics and coding in the Julia language. I've been helping the Julia community with discussions, issues and PRs; as a moderator of the Humans of Julia Discord community; contributing to the SciML: Open Source Software for Scientific Machine Learning organization as part of the DiffEq team; and contributing to the JuliaDynamics organization, developing the package LagrangianDescriptors.jl.

Other relevant packages I am developing myself are ChainPlots.jl, UnitfulBuckinhamPi.jl, and UnitfulAssets.jl.

Among other hobbies, I am also a homebrewer, brewing beer since 2000, and one of the founders of the ACervA Carioca, which played a major role on the growth of the homebrewing community in Brazil. Although mostly a homebrewer, I have made a few commercial beers, partening with microbreweries and restaurants, such as the award winning Colorado Demoiselle (gold medal at the European Beer Star Awards 2008), Colorado Berthô, with Brazil nuts (Castanha do Pará), DadoBier Double Chocolate Stout (DCS); Aprazível Pale Ale; and Mistura Clássica Vertigem IPA (gold medal at the Mondial de La Bière 2014), among others.

⛩ 📫

      Website

      Email

📈 Some Stats:

Top Langs

chainplots.jl's People

Contributors

montyvesselinov avatar musoke avatar pitmonticone avatar rgobbel avatar rmsrosa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chainplots.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Build graph directly, when looking for the connections

Currently, the method neuron_connections(m::Flux.Chain, input_data::Union{Nothing,Array} = nothing) traverses the neural network layers and builds a Vector{Dict{Tuple, Vector{Tuple}}} with all the connections between consecutive layers. In a second step, chaingraph takes this connections and builds a metagraph, which internally is stored as Vector{Vector{Tuple}} (joining every key-value pair into a vector. This is orders of magnitude more efficient.

So the idea is to either build a Vector{Vector{Tuple}} instead of Vector{Dict{Tuple, Vector{Tuple}}}, as an intermediate step, or build the graph directly, fusing the two methods.

Issue with custom layer

Many thanks for the nice package!

I am encountering the following issue when trying to plot a NN with a custom layer. While the following code works as expected

custom(x) = [x[1]^2, x[2]^2, x[3]]
nnx = Chain(custom, Dense(3,4), Dense(4,2))
plot(nnx, rand(3), title="$nna")

the following small modification of it does not:

custom(x) = [x[1]^2, x[2]^2, sin(x[3])]
nnx = Chain(custom, Dense(3,4), Dense(4,2))
plot(nnx, rand(3), title="$nna")

The latter code fails with error

ERROR: MethodError: no method matching sin(::ChainPlots.NeuralNumbers.NeuralNumber)

I tried to extend the function sin to NeuralNumbers, but the issue persisted, so any help would be much appreciated.

EDIT: Actually, the following line

Base.sin(x::ChainPlots.NeuralNumbers.NeuralNumber) = x

fixes the issue. It would be nice to have native support for sin and cos, though.

Ambiguity with `cpu` and `gpu`

  1. This is a nice package. Will you be registering it with the package manager soon?
  2. Going with the trend "Plots" and "StatsPlots", adding an "s" at the end ("ChainPlots") might be nice.
  3. There is some issue using your package with CUDA and Flux:
using CUDA, Flux, ChainPlot
arr = [1,2,3] |> cpu

leads to:

MethodError: adapt_storage(::Flux.FluxCPUAdaptor, ::Vector{Int64}) is ambiguous. Candidates:
  adapt_storage(NeuronState, xs::AbstractArray{<:Number}) in ChainPlot.NeuronNumbers at C:\Users\matth\.julia\packages\ChainPlot\XVMxo\src\NeuronNumbers.jl:137
  adapt_storage(to::Flux.FluxCPUAdaptor, x::AbstractArray) in Flux at C:\Users\matth\.julia\packages\Flux\qAdFM\src\functor.jl:106
Possible fix, define
  adapt_storage(::Flux.FluxCPUAdaptor, ::AbstractArray{<:Number})

The same issue with GPU, e.g., [1,2,3] |> gpu...

relu cooling off hotneurons

Connections between neurons are now inferred using the submodule NeuronNumbers, which contains coldneurons and hotneurons. Problem is that relu(hotneuron) should return hotneuron but is returning coldneuron.

example from readme results in following error

https://github.com/rmsrosa/ChainPlot.jl#examples
with julia 1.7.1

julia> plot(nnr, title="With theme solarized_light", titlefontsize=10)
ERROR: MethodError: no method matching add_edge!(::MetaGraphs.MetaGraph{Int64, Float64}, ::Int64, ::Int64)
Closest candidates are:
  add_edge!(::LightGraphs.SimpleGraphs.AbstractSimpleGraph, ::Any, ::Any) at ~/.julia/packages/LightGraphs/IgJif/src/SimpleGraphs/SimpleGraphs.jl:90
  add_edge!(::LightGraphs.SimpleGraphs.AbstractSimpleGraph, ::Any) at ~/.julia/packages/LightGraphs/IgJif/src/SimpleGraphs/SimpleGraphs.jl:86
Stacktrace:
 [1] chaingraph(m::Chain{Tuple{Dense{typeof(σ), Matrix{Float32}, Vector{Float32}}, Flux.Recur{Flux.RNNCell{typeof(relu), Matrix{Float32}, Vector{Float32}, Matrix{Float32}}, Matrix{Float32}}, Flux.Recur{Flux.LSTMCell{Matrix{Float32}, Vector{Float32}, Tuple{Matrix{Float32}, Matrix{Float32}}}, Tuple{Matrix{Float32}, Matrix{Float32}}}, Flux.Recur{Flux.GRUCell{Matrix{Float32}, Vector{Float32}, Matrix{Float32}}, Matrix{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}, input_data::Nothing)
   @ ChainPlot ~/.julia/packages/ChainPlot/Ua2jN/src/chaingraph.jl:77
 [2] macro expansion
   @ ~/.julia/packages/ChainPlot/Ua2jN/src/chainplotrecipe.jl:56 [inlined]
 [3] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, m::Chain, input_data::Union{Nothing, Array})
   @ ChainPlot ~/.julia/packages/RecipesBase/qpxEX/src/RecipesBase.jl:289
 [4] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, m::Chain)
   @ ChainPlot ~/.julia/packages/RecipesBase/qpxEX/src/RecipesBase.jl:283
 [5] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
   @ RecipesPipeline ~/.julia/packages/RecipesPipeline/oVorB/src/user_recipe.jl:36
 [6] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
   @ RecipesPipeline ~/.julia/packages/RecipesPipeline/oVorB/src/RecipesPipeline.jl:70
 [7] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
   @ Plots ~/.julia/packages/Plots/cPJQu/src/plot.jl:208
 [8] #plot#135
   @ ~/.julia/packages/Plots/cPJQu/src/plot.jl:91 [inlined]
 [9] top-level scope

What is required to plot a new layer type?

I have defined a new layer which contains a SparseMatrixCSC. I would like to plot this layer to show how if differs from Dense.

Is this possible already? It seems not, but I may have missed something.

If not, what functions must be defined to plot such a layer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.