# Latest

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

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

**Page:** 1373

---

## [Obtain gradient of function at end of iterations in Optim.jl](https://discourse.julialang.org/t/obtain-gradient-of-function-at-end-of-iterations-in-optim-jl/62244)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 3\
**Last updated:** [June 3, 2021, 12:02am UTC](https://discourse.julialang.org/t/obtain-gradient-of-function-at-end-of-iterations-in-optim-jl/62244 "2021-06-03T00:02:53Z")

</div>

Is it possible to obtain the gradient of the objective function at the iterations limit? There is a field in the object returned that is named g\_residual, that would give me the max norm of the gradient, but I am interes…

---

## [How to get axes from figure?](https://discourse.julialang.org/t/how-to-get-axes-from-figure/62307)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 11:15pm UTC](https://discourse.julialang.org/t/how-to-get-axes-from-figure/62307 "2021-06-02T23:15:25Z")

</div>

I have a figure whose layout is \> fig.layout GridLayout\[4, 1\] with 4 children ┣━ \[1, 1\] Axis ┣━ \[2, 1\] Axis ┣━ \[3, 1\] Axis ┗━ \[4, 1\] Axis How can I get the axes from that?

---

## [Adding Labels to Inset/Lens Plots](https://discourse.julialang.org/t/adding-labels-to-inset-lens-plots/62304)

<div class="topic-metadata">

**Author:** [@arnab](https://discourse.julialang.org/u/arnab)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 11:12pm UTC](https://discourse.julialang.org/t/adding-labels-to-inset-lens-plots/62304 "2021-06-02T23:12:27Z")

</div>

I am trying to use lens! to zoom in on part of a plot following this tutorial. However, I want to add a separate label to the inset plot. Is there an easy way to do this in Julia? Thanks!

---

## [Error with \`show\` for abbreviated type printing](https://discourse.julialang.org/t/error-with-show-for-abbreviated-type-printing/62190)

<div class="topic-metadata">

**Author:** [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Replies:** 8\
**Last updated:** [June 2, 2021, 11:05pm UTC](https://discourse.julialang.org/t/error-with-show-for-abbreviated-type-printing/62190 "2021-06-02T23:05:09Z")

</div>

Let’s say I have a type with an abbreviated show method for the type itself (for shortened stacktraces). struct Blarg{X,Y} x::X y::Y end Base.show(io::IO, ::Type{Blarg{X,Y}}) where {X,Y} = print(io, "Blarg{$X,.…

---

## [Why does the hash() method produce the same hash after a field value changes?](https://discourse.julialang.org/t/why-does-the-hash-method-produce-the-same-hash-after-a-field-value-changes/62286)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 9\
**Last updated:** [June 2, 2021, 10:04pm UTC](https://discourse.julialang.org/t/why-does-the-hash-method-produce-the-same-hash-after-a-field-value-changes/62286 "2021-06-02T22:04:47Z")

</div>

Consider the following code: mutable struct Person name::String age::Int32 end svetlana = Person("Queen Svetlana",25) println(hash(svetlana)) # 1143118284 svetlana.age = 30 println(hash(svetlana)) # 1143118284…

---

## [Adding package issue with Julia and VS Code](https://discourse.julialang.org/t/adding-package-issue-with-julia-and-vs-code/62302)

<div class="topic-metadata">

**Author:** [@Prani\_Nalluri](https://discourse.julialang.org/u/Prani_Nalluri)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 9:35pm UTC](https://discourse.julialang.org/t/adding-package-issue-with-julia-and-vs-code/62302 "2021-06-02T21:35:13Z")

</div>

Julia was working well on my computer until about last month. It appears that adding packages in the code throws an error. Adding a package in the Julia REPL window in VS Code throws no errors. However, running the actua…

---

## [\[ANN\] Catwalk.jl - With dynamic dispatch to the moon! (an adaptive optimizer, aka JIT compiler)](https://discourse.julialang.org/t/ann-catwalk-jl-with-dynamic-dispatch-to-the-moon-an-adaptive-optimizer-aka-jit-compiler/57917)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 14\
**Last updated:** [June 2, 2021, 8:26pm UTC](https://discourse.julialang.org/t/ann-catwalk-jl-with-dynamic-dispatch-to-the-moon-an-adaptive-optimizer-aka-jit-compiler/57917 "2021-06-02T20:26:18Z")

</div>

I ended up implementing one of my pipe dreams, and hey, it works! :smiley: Catwalk.jl Intro Catwalk.jl can speed up long-running Julia processes by minimizing the overhead of dynamic dispatch. It is a JIT compiler that…

---

## [Permissions for installing packages on julia in slurm cluster](https://discourse.julialang.org/t/permissions-for-installing-packages-on-julia-in-slurm-cluster/62246)

<div class="topic-metadata">

**Author:** [@JDA](https://discourse.julialang.org/u/JDA)\
**Replies:** 13\
**Last updated:** [June 2, 2021, 8:25pm UTC](https://discourse.julialang.org/t/permissions-for-installing-packages-on-julia-in-slurm-cluster/62246 "2021-06-02T20:25:40Z")

</div>

Hello, I am having some issues with permissions getting julia started on a slurm cluster. I could use some assistance, if possible. The issue is explained here https://stackoverflow.com/questions/67794194/permissions-…

---

## [Libraries for Computational Graphs](https://discourse.julialang.org/t/libraries-for-computational-graphs/62293)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 2\
**Last updated:** [June 2, 2021, 7:16pm UTC](https://discourse.julialang.org/t/libraries-for-computational-graphs/62293 "2021-06-02T19:16:38Z")

</div>

Hi, I have functions that look something like this: C(x) = A(x) + B(x) B(x) = 2\*A(x) A(x) = exp(x) where I’d like to calculate C(x) while only evaluating A(x) once. The actual situation is more complex, e.g. a naive i…

---

## [RNN only works with Float32?](https://discourse.julialang.org/t/rnn-only-works-with-float32/62292)

<div class="topic-metadata">

**Author:** [@EdgarHR](https://discourse.julialang.org/u/EdgarHR)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 7:11pm UTC](https://discourse.julialang.org/t/rnn-only-works-with-float32/62292 "2021-06-02T19:11:09Z")

</div>

Hello everyone, I wanted to build an RNN model and it seems to be the case that Flux only accepts Float32 as inputs. For instance if I run the following code using Flux rnn = RNN(1,1) rnn(\[1\]) # Gives error rnn(\[conver…

---

## [Makie: Combine plots into subplots](https://discourse.julialang.org/t/makie-combine-plots-into-subplots/62280)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 4\
**Last updated:** [June 2, 2021, 6:51pm UTC](https://discourse.julialang.org/t/makie-combine-plots-into-subplots/62280 "2021-06-02T18:51:31Z")

</div>

In Plots.jl, I can make a plot and then use it either as a stand-alone figure or as a subplot: using Plots myplot(n) = plot(1 : n; xlabel = "x") f1 = myplot(10); f2 = myplot(20); fig = plot(f1, f2); Can I do somethin…

---

## [Problem with @avx and LoopVectorization: UndefVarError](https://discourse.julialang.org/t/problem-with-avx-and-loopvectorization-undefvarerror/62279)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 3\
**Last updated:** [June 2, 2021, 5:13pm UTC](https://discourse.julialang.org/t/problem-with-avx-and-loopvectorization-undefvarerror/62279 "2021-06-02T17:13:17Z")

</div>

Hello, I am running the following code using LoopVectorization, using Random, BenchmarkTools, LoopVectorization J = 1000 T = 100 Mat1 = rand(J,J) vec1 = rand(J) Mat2= rand(J,J) vec2 = rand(J) Mat3 = rand(J,J,T) ve…

---

## [Custom RNN cell. Help needed to improve performance](https://discourse.julialang.org/t/custom-rnn-cell-help-needed-to-improve-performance/60536)

<div class="topic-metadata">

**Author:** [@lungd](https://discourse.julialang.org/u/lungd)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 5:10pm UTC](https://discourse.julialang.org/t/custom-rnn-cell-help-needed-to-improve-performance/60536 "2021-06-02T17:10:02Z")

</div>

I am working on an implementation of a sparsely connected RNN cell. The training of the cell is very slow. My code is not completely type stable and there are for sure some rookie mistakes as well. I hope that this is t…

---

## [How to divide vector elements in Julia?](https://discourse.julialang.org/t/how-to-divide-vector-elements-in-julia/62274)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 2\
**Last updated:** [June 2, 2021, 4:50pm UTC](https://discourse.julialang.org/t/how-to-divide-vector-elements-in-julia/62274 "2021-06-02T16:50:42Z")

</div>

Hello, I have an array composed by a vector of two elements: (in the form \[1, 2\], \[3,4\],...). I would like to calculate the percentage of each element, so I calculated the sum of the vector (obtaining something in the f…

---

## [Structure that creates thread-specific global variables](https://discourse.julialang.org/t/structure-that-creates-thread-specific-global-variables/62287)

<div class="topic-metadata">

**Author:** [@jessymilare](https://discourse.julialang.org/u/jessymilare)\
**Replies:** 0\
**Last updated:** [June 2, 2021, 4:02pm UTC](https://discourse.julialang.org/t/structure-that-creates-thread-specific-global-variables/62287 "2021-06-02T16:02:45Z")

</div>

Often, we need to create some global variable whose value is different for each thread. This is often needed for storing some mathematical context variable (like precision, rounding, RNG, etc). Usually, this code patter…

---

## [Run(\`git --version\`) on Windows errors](https://discourse.julialang.org/t/run-git-version-on-windows-errors/62198)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 13\
**Last updated:** [June 2, 2021, 2:29pm UTC](https://discourse.julialang.org/t/run-git-version-on-windows-errors/62198 "2021-06-02T14:29:04Z")

</div>

Hi all, why does it error? julia\> run(\`git --version\`) ERROR: IOError: could not spawn \`git --version\`: no such file or directory (ENOENT) Stacktrace: \[1\] \_spawn\_primitive(file::String, cmd::Cmd, stdio::Vector{Any}) …

---

## [Makie @lift for a function with multiple outputs?](https://discourse.julialang.org/t/makie-lift-for-a-function-with-multiple-outputs/62236)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 3\
**Last updated:** [June 2, 2021, 1:54pm UTC](https://discourse.julialang.org/t/makie-lift-for-a-function-with-multiple-outputs/62236 "2021-06-02T13:54:25Z")

</div>

I’m trying to make a menu in Makie which changes the plot. Basically this: using GLMakie fig = Figure() menu = Menu(fig, options = \[1,2\]) fig\[1, 1\] = vgrid!( Label(fig, "Index a", width = nothing),menu; tellhei…

---

## [String matching with variable interpolation](https://discourse.julialang.org/t/string-matching-with-variable-interpolation/62276)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 2\
**Last updated:** [June 2, 2021, 1:24pm UTC](https://discourse.julialang.org/t/string-matching-with-variable-interpolation/62276 "2021-06-02T13:24:29Z")

</div>

Hi, I have the following: field = "out" match(r"\<out\>\\s\*(.\*?)\\s\*\</out\>",\<out\>hello\</out\>) But I would like to replace the “out” in \<out\>\\s\*(.\*?)\\s\*\</out\> by field to make it dynamic. How can i do that? Thank you

---

## [Julian way to check for valid combination of inputs when defining function](https://discourse.julialang.org/t/julian-way-to-check-for-valid-combination-of-inputs-when-defining-function/62267)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 12:22pm UTC](https://discourse.julialang.org/t/julian-way-to-check-for-valid-combination-of-inputs-when-defining-function/62267 "2021-06-02T12:22:16Z")

</div>

What is the recommended way to do the following? struct Relation n::Int64 R::Set end Base.union(r1::Relation,r2::Relation) = if (some condition of r1 and r2) then … I think when (some condition of r1 and r2) is r…

---

## [Print elements of vector without the braces](https://discourse.julialang.org/t/print-elements-of-vector-without-the-braces/62269)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 12:16pm UTC](https://discourse.julialang.org/t/print-elements-of-vector-without-the-braces/62269 "2021-06-02T12:16:38Z")

</div>

Many times I want to output a simple data table from a vector, like in this MWE: julia\> for i in 1:5 println(rand(3)) end \[0.6125928743733668, 0.36073254544716105, 0.5008360754548771\] \[0.0429530986755386…

---

## [Specifying Project.toml when starting Julia repository with binder](https://discourse.julialang.org/t/specifying-project-toml-when-starting-julia-repository-with-binder/62266)

<div class="topic-metadata">

**Author:** [@bennibolm](https://discourse.julialang.org/u/bennibolm)\
**Replies:** 0\
**Last updated:** [June 2, 2021, 11:53am UTC](https://discourse.julialang.org/t/specifying-project-toml-when-starting-julia-repository-with-binder/62266 "2021-06-02T11:53:42Z")

</div>

Hey, I want to set up some tutorials with mybinder. But my .ipynb and .toml files are not in the root of my repository. Is there any possibility to start binder with a specified Project.toml from a subdirectory to avoi…

---

## [Transferring a matrix from Mathematica to Julia](https://discourse.julialang.org/t/transferring-a-matrix-from-mathematica-to-julia/61910)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 3\
**Last updated:** [June 2, 2021, 11:51am UTC](https://discourse.julialang.org/t/transferring-a-matrix-from-mathematica-to-julia/61910 "2021-06-02T11:51:39Z")

</div>

What is the recommended ways to transfer a matrix generated in Mathematica to Julia and benefits/disadvantages? My workflow is the following: generate matrices in Mathematica transfer the matrices to Julia (via some st…

---

## [Plots.jl tiny plots in jupyter-notebook](https://discourse.julialang.org/t/plots-jl-tiny-plots-in-jupyter-notebook/14770)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 10\
**Last updated:** [September 23, 2018, 4:49am UTC](https://discourse.julialang.org/t/plots-jl-tiny-plots-in-jupyter-notebook/14770 "2018-09-23T04:49:58Z")

</div>

Pkg upgraded my packages and now all jupyter-notbook plots are tiny. Any idea how to fix this?

---

## [Specifying ode solver options to speed up compute time](https://discourse.julialang.org/t/specifying-ode-solver-options-to-speed-up-compute-time/61784)

<div class="topic-metadata">

**Author:** [@Deepa](https://discourse.julialang.org/u/Deepa)\
**Replies:** 42\
**Last updated:** [June 2, 2021, 11:28am UTC](https://discourse.julialang.org/t/specifying-ode-solver-options-to-speed-up-compute-time/61784 "2021-06-02T11:28:11Z")

</div>

Hello All, This is a follow up to my question posted here. I’ve installed Julia in windows and I am running the following code (posted in the above-mentioned link) via the Julia plugin instaled in Pycharm. using Diff…

---

## [Are BigFloats unable to exactly represent 0.1?](https://discourse.julialang.org/t/are-bigfloats-unable-to-exactly-represent-0-1/62192)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 12\
**Last updated:** [June 2, 2021, 11:05am UTC](https://discourse.julialang.org/t/are-bigfloats-unable-to-exactly-represent-0-1/62192 "2021-06-02T11:05:34Z")

</div>

0.1 is a number that can be exactly represented by a Float16, or Float32, or a Float64. (at least according to how we print them) But not it would seem (at least according to printing) by a BigFloat. julia\> parse(Floa…

---

## [Assert relationship between variables with Symbolics.jl](https://discourse.julialang.org/t/assert-relationship-between-variables-with-symbolics-jl/62204)

<div class="topic-metadata">

**Author:** [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 10:09am UTC](https://discourse.julialang.org/t/assert-relationship-between-variables-with-symbolics-jl/62204 "2021-06-02T10:09:02Z")

</div>

Hi I was just wondering if there’s a way to assert and then test for a relationship between two varablie in Symbolics, or Julia in general. Specifically, a game theory payoff table | | R | W |R| 0 | b |W| b-k…

---

## [Flux: training loop logging for custom structure and model](https://discourse.julialang.org/t/flux-training-loop-logging-for-custom-structure-and-model/62211)

<div class="topic-metadata">

**Author:** [@jgbrasier](https://discourse.julialang.org/u/jgbrasier)\
**Replies:** 7\
**Last updated:** [June 2, 2021, 9:41am UTC](https://discourse.julialang.org/t/flux-training-loop-logging-for-custom-structure-and-model/62211 "2021-06-02T09:41:27Z")

</div>

Hello everyone I am pretty new to using Julia for ML. I am training a custom model (Kalman Filter) that is a mutable structure. I am trying to update and log the parameters at each time step (in my case for each measure…

---

## [Tutorials or examples on multithreading and distributed processing for numerical PDEs](https://discourse.julialang.org/t/tutorials-or-examples-on-multithreading-and-distributed-processing-for-numerical-pdes/62153)

<div class="topic-metadata">

**Author:** [@Debasish](https://discourse.julialang.org/u/Debasish)\
**Replies:** 8\
**Last updated:** [June 2, 2021, 7:52am UTC](https://discourse.julialang.org/t/tutorials-or-examples-on-multithreading-and-distributed-processing-for-numerical-pdes/62153 "2021-06-02T07:52:15Z")

</div>

Hello everyone, I have migrated to Julia about less than a month ago from Fortran + Matlab. I started learning C++ last year to write MPI codes but found it too cumbersome. In Julia, my main goal is to write parallel c…

---

## [Plot data on Map with GMT.jl](https://discourse.julialang.org/t/plot-data-on-map-with-gmt-jl/61937)

<div class="topic-metadata">

**Author:** [@mixstam1453](https://discourse.julialang.org/u/mixstam1453)\
**Replies:** 14\
**Last updated:** [June 2, 2021, 7:41am UTC](https://discourse.julialang.org/t/plot-data-on-map-with-gmt-jl/61937 "2021-06-02T07:41:00Z")

</div>

Hi everyone, I want to plot an 180x360 array on the Earth surface with coastlines. I know how to do it pycalling Cartopy, but i found GMT.jl interesting and usefull, but a little bit difficult to understand it as i am n…

---

## [Parallelizing a for-loop with a matrix](https://discourse.julialang.org/t/parallelizing-a-for-loop-with-a-matrix/62250)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 2\
**Last updated:** [June 2, 2021, 7:00am UTC](https://discourse.julialang.org/t/parallelizing-a-for-loop-with-a-matrix/62250 "2021-06-02T07:00:50Z")

</div>

I have a simple for-loop with a matrix, where I calculate a slice of the matrix via each step of the for-loop. e.g. for ilat = 1 : nlat, ilon = 1 : nlon for ip = 1 : np; esat\[ip+1\] = t2esat(Ta\[ilon,ilat,ip\],p\[ip+1…

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

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