Giter Club home page Giter Club logo

Comments (2)

jonniedie avatar jonniedie commented on May 20, 2024

This is something I've wanted to implement for a while, and even made up a quick prototype for a few months back. It's nice for state-space modeling too because you can have a C*x + D*u output signal. Also, activation functions for NNs.

This syntax is better than the one I had, too. Although, my preference would be to have the function as the first argument.

Time permitting, I'm going to try to get something working within the next few days. There are a few changes that will have to be made to get this working, but nothing that will require too much major surgery.

from componentarrays.jl.

jonniedie avatar jonniedie commented on May 20, 2024

I think the first time I read this I missed the significance of the fact that it's looking at the upper level. Most of the use cases I have for alias components are applying functions to components within the same level.

So really this is two separate issues:

  1. We need to have alias components
  2. Those aliases should have a way to reference the components above them

I'd like to have a way to accomplish the first without having to have a ThisLevel.

My original thoughts were something like:

x = ComponentArray(
	a = 1,
	b = 2,
	c = AliasVar(x -> x.a + x.b)
)

So AliasVar would always take in a function of one variable, which is the ComponentArray that holds the AliasVar (in this case x). Maybe a way of accomplishing both would be something like:

x = ComponentArray(
    comp1 = ComponentArray(out = 1),
    comp2 = ComponentArray(in = AliasVar(x -> fun(UpperLevel(x).comp1.out))),
)

It's a little more verbose for this case, but it handles the first case without having to introduce a ThisLevel. Also, I think this makes it more straightforward to understand for the case where you might want to go even higher level like UpperLevel(UpperLevel(x)).

from componentarrays.jl.

Related Issues (20)

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.