Comments (4)
Again, I don't think there's a clean way of obtaining what you're looking for in general: once you sum two functions of the same type, you're already screwed since they will have the same set of fields.
The way I see it, either
- the fields you want to inspect reflect into some general property of functions, so that you can define the same property in terms of the property of the components, or
- you have a sufficiently restricted set of cases, such as "
f
is theSum
of multiple functions, some of which are ofSqrNormL2
", in which case you can also do something like
for component in f.fs
if typeof(component) <: SqrNormL2
# do something about component.lambda
end
end
from proximaloperators.jl.
It’s hard for me to see how this could be done: That lambda
parameter is very specific to SqrNormL2
, why do you need it? To get to some general property of functions? Maybe Lipschitz constant or convexity modulus?
from proximaloperators.jl.
One option, in case you have a restricted combination of possible types, is to define access methods like
get_lambda(f::SqrNormL2) = f.lambda
get_lambda(f::Sum{Tuple{SqrNormL2, T}}) where T = f.fs[1].lambda
since multiple dispatch is awesome. But again, depending on how many combinations are allowed you may need to complicate the above example.
from proximaloperators.jl.
I actually need the linear mappings (in order to compute direction for a linesearch) that are precomposed with logisticlosses and then the whole thing is summed with sqrNorml2s.
The multiple dispatch suggestion would work but it is still kinda ugly to separate into cases. That's why I was thinking maybe it would be easier for the calculus rules to be blind to how they are created.
I guess with calculus functions like sum it can be tricky since the summed functions may have overlapping fields. But in other cases like precompose I guess it can be done without issues. But then again I didn't think it through. Any way I'll go with your suggestion.
from proximaloperators.jl.
Related Issues (20)
- Add prox! method for IndPSD handling matrices
- possible test failure in upcoming Julia version 1.5 HOT 1
- Projection on Stiefel manifold HOT 1
- Polishing docstrings
- Computing proximal operator of a constrained convex function HOT 5
- Nonnegative least squares example HOT 3
- TagBot trigger issue HOT 18
- TV norm prox HOT 6
- Replace exponential cone projection? HOT 3
- Lightweight “base” package with core definitions
- Sums of norms HOT 2
- SqrNormL2 expects λ to be positive HOT 3
- Is ProximableFunction no longer supported? HOT 2
- nonconvex prox calculus rule HOT 1
- Multi-threaded operators evaluation
- Improve pretty printing HOT 3
- GPU support via CuArrays.jl HOT 12
- Prox of Sum HOT 2
- Locally Low-Rank operator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proximaloperators.jl.