# Latest

**URL:** https://discourse.julialang.org/latest.md?page=887

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 888

---

## [Custom layer for a good guess of system dynamics](https://discourse.julialang.org/t/custom-layer-for-a-good-guess-of-system-dynamics/88728)

<div class="topic-metadata">

**Author:** [@Antonino\_Gandolfo](https://discourse.julialang.org/u/Antonino_Gandolfo)\
**Replies:** 9\
**Last updated:** [October 22, 2022, 4:25pm UTC](https://discourse.julialang.org/t/custom-layer-for-a-good-guess-of-system-dynamics/88728 "2022-10-22T16:25:09Z")

</div>

Hi, I’m trying to create a NeuralODE for the forcasting of a dynamic system. I did a NN for the forcasting of the system under different initial conditions and it’s work very well. Now I would like to create NN capable…

---

## [Why doesn't \`@nospecialize\` work in this example?](https://discourse.julialang.org/t/why-doesnt-nospecialize-work-in-this-example/88695)

<div class="topic-metadata">

**Author:** [@Zach\_Christensen](https://discourse.julialang.org/u/Zach_Christensen)\
**Replies:** 10\
**Last updated:** [October 22, 2022, 3:01pm UTC](https://discourse.julialang.org/t/why-doesnt-nospecialize-work-in-this-example/88695 "2022-10-22T15:01:07Z")

</div>

Just discovered that using @nospecialize on a method loses it’s effect as soon as its called by a specialized method. julia\> using MethodAnalysis julia\> struct Foo{X} x::X end julia\> @nospecialize j…

---

## [Map a function at a given level of a tree](https://discourse.julialang.org/t/map-a-function-at-a-given-level-of-a-tree/27910)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 7\
**Last updated:** [October 22, 2022, 1:59pm UTC](https://discourse.julialang.org/t/map-a-function-at-a-given-level-of-a-tree/27910 "2022-10-22T13:59:56Z")

</div>

I feel a bit dumb asking this very basic question, but I have looked and looked but cannot figure it out. Imagine I have a “tree”, in the sense of a container of containers of containers… Such as julia\> tree = \[\[\[1,2\],…

---

## [Aliased parameterized type confusion, cannot construct instance](https://discourse.julialang.org/t/aliased-parameterized-type-confusion-cannot-construct-instance/89088)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 3\
**Last updated:** [October 22, 2022, 1:18pm UTC](https://discourse.julialang.org/t/aliased-parameterized-type-confusion-cannot-construct-instance/89088 "2022-10-22T13:18:15Z")

</div>

Why does this work, tst{T \<: AbstractFloat} = SMatrix{3,3,T} tst(rand(3,3)) 3×3 SMatrix{3, 3, Float64, 9} with indices SOneTo(3)×SOneTo(3): 0.901624 0.966323 0.397229 0.716175 0.758242 0.791737 0.839526 0.7984…

---

## [How to optimize computation within vectorized list operation and large array?](https://discourse.julialang.org/t/how-to-optimize-computation-within-vectorized-list-operation-and-large-array/89008)

<div class="topic-metadata">

**Author:** [@swish47](https://discourse.julialang.org/u/swish47)\
**Replies:** 16\
**Last updated:** [October 21, 2022, 4:23pm UTC](https://discourse.julialang.org/t/how-to-optimize-computation-within-vectorized-list-operation-and-large-array/89008 "2022-10-21T16:23:27Z")

</div>

I want to do this type of computation: ot=collect(range(start=-3,length=3600\*4,stop=3)); st=rand(1000000); sgf=zeros(ComplexF64, length(ot)); @elapsed @time for nn in 1:length(ot) sgf\[nn\]=sum(1 ./ (ot\[nn\]+0.001\*im.-…

---

## [Stability of sort()](https://discourse.julialang.org/t/stability-of-sort/89101)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [October 22, 2022, 10:04am UTC](https://discourse.julialang.org/t/stability-of-sort/89101 "2022-10-22T10:04:11Z")

</div>

Is the sort function stable by default, i.e preserving entries that are equal under the comparison function? If not, can I still expect the outcome of sort to be independent of the Julia version, say, 1.7 vs 1.8, for rep…

---

## [JuMP constraint with limited dimension of an index](https://discourse.julialang.org/t/jump-constraint-with-limited-dimension-of-an-index/89100)

<div class="topic-metadata">

**Author:** [@MeryKay](https://discourse.julialang.org/u/MeryKay)\
**Replies:** 1\
**Last updated:** [October 22, 2022, 9:57am UTC](https://discourse.julialang.org/t/jump-constraint-with-limited-dimension-of-an-index/89100 "2022-10-22T09:57:15Z")

</div>

Hi everyboday! In one constraint, I want to limit my index to a specific intervall within the intervall which is used in all other cases. More specific this means: index p is normally defined in p = 1:P whereby P=10 N…

---

## [DataDriven Approach for recovering DAE system of governing equations](https://discourse.julialang.org/t/datadriven-approach-for-recovering-dae-system-of-governing-equations/88822)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 3\
**Last updated:** [October 22, 2022, 9:05am UTC](https://discourse.julialang.org/t/datadriven-approach-for-recovering-dae-system-of-governing-equations/88822 "2022-10-22T09:05:55Z")

</div>

Can I know if data driven recovery of governing equations that can be a DAE system is possible with DMD or SINDy approach in DataDrivenDiffEq.jl? I have referred the examples in the documentation of DataDrivenDiffEq.jl b…

---

## [Optimizing noisy objective](https://discourse.julialang.org/t/optimizing-noisy-objective/25260)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 60\
**Last updated:** [October 22, 2022, 8:19am UTC](https://discourse.julialang.org/t/optimizing-noisy-objective/25260 "2022-10-22T08:19:10Z")

</div>

I have a f: \\mathbb{R}^n \\to \\mathbb{R}^m function, m \> n, and I am trying to minimize some norm of f(x). The norm itself is flexible, I would like to get something working. The problem is that f is stochastic as it com…

---

## [Memory hogging loops](https://discourse.julialang.org/t/memory-hogging-loops/89073)

<div class="topic-metadata">

**Author:** [@jrhalket](https://discourse.julialang.org/u/jrhalket)\
**Replies:** 18\
**Last updated:** [October 22, 2022, 6:32am UTC](https://discourse.julialang.org/t/memory-hogging-loops/89073 "2022-10-22T06:32:34Z")

</div>

Hi all, I’m still trying to figure out how to get around a familiar problem regarding repeated calls of a function causing nearly linearly increases in memory demands. Here’s a minimal example. I’m not really interested …

---

## [Write a function that stands up and shuts down workers?](https://discourse.julialang.org/t/write-a-function-that-stands-up-and-shuts-down-workers/89041)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 5\
**Last updated:** [October 22, 2022, 5:25am UTC](https://discourse.julialang.org/t/write-a-function-that-stands-up-and-shuts-down-workers/89041 "2022-10-22T05:25:19Z")

</div>

I have a utility in a package to run a batch of things. I’d like for that batch function to be able to take in an argument like n\_workers, then stand those workers up, distribute the work, and then remove those new worke…

---

## [Significant time spent in type inference in profiler flame graphs](https://discourse.julialang.org/t/significant-time-spent-in-type-inference-in-profiler-flame-graphs/89094)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 4\
**Last updated:** [October 22, 2022, 3:58am UTC](https://discourse.julialang.org/t/significant-time-spent-in-type-inference-in-profiler-flame-graphs/89094 "2022-10-22T03:58:45Z")

</div>

I am currently profiling the search speed of SymbolicRegression.jl. In particular I am attempting to speed up this PR, which integrates the package with DynamicExpressions.jl. I am using the following code for profiling…

---

## [VSCode Debugger Crashing On Working Code](https://discourse.julialang.org/t/vscode-debugger-crashing-on-working-code/89096)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 0\
**Last updated:** [October 22, 2022, 1:46am UTC](https://discourse.julialang.org/t/vscode-debugger-crashing-on-working-code/89096 "2022-10-22T01:46:34Z")

</div>

I have code that works when I execute it in the REPL and when I use the julia command from the command line directly. However, when I run the debugger on an attempted dispatch the debugger crashes with: ┌ Error: Some …

---

## [How to specify paths relative to a file rather than current directory?](https://discourse.julialang.org/t/how-to-specify-paths-relative-to-a-file-rather-than-current-directory/89092)

<div class="topic-metadata">

**Author:** [@lkmc](https://discourse.julialang.org/u/lkmc)\
**Replies:** 2\
**Last updated:** [October 22, 2022, 12:25am UTC](https://discourse.julialang.org/t/how-to-specify-paths-relative-to-a-file-rather-than-current-directory/89092 "2022-10-22T00:25:00Z")

</div>

I have a file that I would like to be able to be read from multiple directories. I cannot use absolute paths because I need the code to be able to run for different users on different machines who may have put their rep…

---

## [Are Julia Artifacts only for tarballs?](https://discourse.julialang.org/t/are-julia-artifacts-only-for-tarballs/89039)

<div class="topic-metadata">

**Author:** [@moe\_kayali](https://discourse.julialang.org/u/moe_kayali)\
**Replies:** 2\
**Last updated:** [October 21, 2022, 11:06pm UTC](https://discourse.julialang.org/t/are-julia-artifacts-only-for-tarballs/89039 "2022-10-21T23:06:52Z")

</div>

Hello! I am wondering if I can use Artifact.toml to automatically download static resources I’m using in my Julia package. The catch is that these are (uncompressed) binary files. Here is an minimal example: \[openflight…

---

## [Julia related responses to 2022 Kaggle ML & DS survey](https://discourse.julialang.org/t/julia-related-responses-to-2022-kaggle-ml-ds-survey/89089)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 0\
**Last updated:** [October 21, 2022, 10:26pm UTC](https://discourse.julialang.org/t/julia-related-responses-to-2022-kaggle-ml-ds-survey/89089 "2022-10-21T22:26:08Z")

</div>

Survey data are available at https://www.kaggle.com/competitions/kaggle-survey-2022/data.

---

## [Efficient static bit array](https://discourse.julialang.org/t/efficient-static-bit-array/89084)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 1\
**Last updated:** [October 21, 2022, 10:16pm UTC](https://discourse.julialang.org/t/efficient-static-bit-array/89084 "2022-10-21T22:16:33Z")

</div>

I’m trying to find a way to implement a static bit array that is performant and memory efficient. I wonder if someone has solved some of the issues below. For example, I want to be able to create and access them quickly …

---

## [Does setrounding need to be thread unsafe?](https://discourse.julialang.org/t/does-setrounding-need-to-be-thread-unsafe/89086)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 0\
**Last updated:** [October 21, 2022, 9:38pm UTC](https://discourse.julialang.org/t/does-setrounding-need-to-be-thread-unsafe/89086 "2022-10-21T21:38:07Z")

</div>

setrounding is thread unsafe. Is there a problem with making the rounding mode thread- or task-local?

---

## [Is it bad practice to assign values to the String entries of a DataFrame?](https://discourse.julialang.org/t/is-it-bad-practice-to-assign-values-to-the-string-entries-of-a-dataframe/88943)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 10\
**Last updated:** [October 21, 2022, 9:20pm UTC](https://discourse.julialang.org/t/is-it-bad-practice-to-assign-values-to-the-string-entries-of-a-dataframe/88943 "2022-10-21T21:20:20Z")

</div>

I have to create a set of DataFrames based off of the entries of an existing DataFrame. One way to approach would be to create a function that turns the entires in a DataFrame into variables and then assign values to th…

---

## [Parsing with custom type JSON3 makes performance worse](https://discourse.julialang.org/t/parsing-with-custom-type-json3-makes-performance-worse/89030)

<div class="topic-metadata">

**Author:** [@Robert\_J](https://discourse.julialang.org/u/Robert_J)\
**Replies:** 6\
**Last updated:** [October 21, 2022, 8:56pm UTC](https://discourse.julialang.org/t/parsing-with-custom-type-json3-makes-performance-worse/89030 "2022-10-21T20:56:57Z")

</div>

Here is the sample JSON file: "{\\"topic\\":\\"trade.BTCUSDT\\",\\"data\\":\[{\\"symbol\\":\\"BTCUSDT\\",\\"tick\_direction\\":\\"PlusTick\\",\\"price\\":\\"19431.00\\",\\"size\\":0.2,\\"timestamp\\":\\"2022-10-18T14:50:20.000Z\\",\\"trade\_time\_m…

---

## [Makie workflow to access and change attributes of objects](https://discourse.julialang.org/t/makie-workflow-to-access-and-change-attributes-of-objects/89058)

<div class="topic-metadata">

**Author:** [@weltenbummler](https://discourse.julialang.org/u/weltenbummler)\
**Replies:** 4\
**Last updated:** [October 21, 2022, 8:05pm UTC](https://discourse.julialang.org/t/makie-workflow-to-access-and-change-attributes-of-objects/89058 "2022-10-21T20:05:55Z")

</div>

Hi, This post is about plotting with Makie. I quite often set out making a figure and then later add further plots or labels. My workflow below works but seems a bit cumbersome to me and I would like to have your input …

---

## [How to get "total snapshots" for profile results as Int?](https://discourse.julialang.org/t/how-to-get-total-snapshots-for-profile-results-as-int/89057)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 1\
**Last updated:** [October 21, 2022, 7:55pm UTC](https://discourse.julialang.org/t/how-to-get-total-snapshots-for-profile-results-as-int/89057 "2022-10-21T19:55:47Z")

</div>

Hellow, how to get “total snapshots” for profile results as Int ? using Profile f() = 1 for i = 1 : 100 @profile f() end Profile.print() Overhead ╎ \[+additional indent\] Count File:Line; Function ====================…

---

## [What are Symbols for?](https://discourse.julialang.org/t/what-are-symbols-for/89082)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 1\
**Last updated:** [October 21, 2022, 7:55pm UTC](https://discourse.julialang.org/t/what-are-symbols-for/89082 "2022-10-21T19:55:01Z")

</div>

Today I came across the Symbol type, but I don’t understand what it’s for. The online documenation offers these two examples: julia\> :name :name julia\> typeof(:name) Symbol julia\> x = 42 42 julia\> eval(:x) 42 and wh…

---

## [Reducing the allocations of my function](https://discourse.julialang.org/t/reducing-the-allocations-of-my-function/89059)

<div class="topic-metadata">

**Author:** [@xspeng](https://discourse.julialang.org/u/xspeng)\
**Replies:** 10\
**Last updated:** [October 21, 2022, 4:48pm UTC](https://discourse.julialang.org/t/reducing-the-allocations-of-my-function/89059 "2022-10-21T16:48:19Z")

</div>

Hi, I have a function that can help me find all the qualified numbers that are within certain range, but it just ocupies a lot of allocations. Since I need to repeat this process thousands of time. I hope I can reduce th…

---

## [How to calculate non linear function](https://discourse.julialang.org/t/how-to-calculate-non-linear-function/89072)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 4\
**Last updated:** [October 21, 2022, 6:08pm UTC](https://discourse.julialang.org/t/how-to-calculate-non-linear-function/89072 "2022-10-21T18:08:46Z")

</div>

So I need to calculate x-sin(x)=y where y is known. It isn’t possible to solve for x so I need to approximate. My first try is using Optim f(x) = abs(x-sin(x) - y) optimize(f, 0, 2π).minimizer But to do this for a mat…

---

## [How many flops does it take to compute a square root?](https://discourse.julialang.org/t/how-many-flops-does-it-take-to-compute-a-square-root/89027)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 6\
**Last updated:** [October 21, 2022, 5:20pm UTC](https://discourse.julialang.org/t/how-many-flops-does-it-take-to-compute-a-square-root/89027 "2022-10-21T17:20:27Z")

</div>

How many flops does it take to compute a square root?

---

## [End-to-end gradients with Enzyme when training ODE parameters](https://discourse.julialang.org/t/end-to-end-gradients-with-enzyme-when-training-ode-parameters/89062)

<div class="topic-metadata">

**Author:** [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Replies:** 1\
**Last updated:** [October 21, 2022, 5:19pm UTC](https://discourse.julialang.org/t/end-to-end-gradients-with-enzyme-when-training-ode-parameters/89062 "2022-10-21T17:19:03Z")

</div>

When reading the SciMLSensitivity docs I am somewhat surprised that Enzyme.jl is only mentioned as an option for JVPs. Why is doing e.g. end to end gradient computations with Enzyme (e.g. much like ForwardDiff.jl does) …

---

## [MILP: formulation of sums with barriers](https://discourse.julialang.org/t/milp-formulation-of-sums-with-barriers/89067)

<div class="topic-metadata">

**Author:** [@MeryKay](https://discourse.julialang.org/u/MeryKay)\
**Replies:** 4\
**Last updated:** [October 21, 2022, 5:17pm UTC](https://discourse.julialang.org/t/milp-formulation-of-sums-with-barriers/89067 "2022-10-21T17:17:48Z")

</div>

I want to program a sum over an indexed variable, whereby the index has a barrier just for this constraint. sum(X\[t\] for t=1:T) is clear to me, but how can I integrate the barrier of t\<= R\_j as shown in the screenshot. …

---

## [Fast LogSumExp over 4th dimension](https://discourse.julialang.org/t/fast-logsumexp-over-4th-dimension/64182)

<div class="topic-metadata">

**Author:** [@jroon](https://discourse.julialang.org/u/jroon)\
**Replies:** 36\
**Last updated:** [October 21, 2022, 5:17pm UTC](https://discourse.julialang.org/t/fast-logsumexp-over-4th-dimension/64182 "2022-10-21T17:17:02Z")

</div>

Hi all, I’m rewriting a function from R to Julia that reduces an array across the 4th dimension via LogSumExp, and I’m currently trying to optimise the speed. I’ve made a bit of progress through the Tullio package, but …

---

## [Speeding up my logsumexp function](https://discourse.julialang.org/t/speeding-up-my-logsumexp-function/42380)

<div class="topic-metadata">

**Author:** [@vkv](https://discourse.julialang.org/u/vkv)\
**Replies:** 35\
**Last updated:** [October 21, 2022, 5:14pm UTC](https://discourse.julialang.org/t/speeding-up-my-logsumexp-function/42380 "2022-10-21T17:14:51Z")

</div>

I wrote a logsumexp function based on the code here, that takes matrix as input and applies logsumexp along a dimension in a numerically stable way. function lsexp\_mat(mat, zero1\_mat; dims=1) # To use the function zer…

[Previous page](https://discourse.julialang.org/latest.md?page=886)

[Next page](https://discourse.julialang.org/latest.md?page=888)
