# Latest

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

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

**Page:** 1285

---

## [Speeding up gradients for custom neural network - currently much slower than in PyTorch](https://discourse.julialang.org/t/speeding-up-gradients-for-custom-neural-network-currently-much-slower-than-in-pytorch/50637)

<div class="topic-metadata">

**Author:** [@Andreas\_Schlaginhauf](https://discourse.julialang.org/u/Andreas_Schlaginhauf)\
**Replies:** 16\
**Last updated:** [August 28, 2021, 4:52pm UTC](https://discourse.julialang.org/t/speeding-up-gradients-for-custom-neural-network-currently-much-slower-than-in-pytorch/50637 "2021-08-28T16:52:49Z")

</div>

I am currently trying to implement stable neural ODEs according to https://arxiv.org/pdf/2001.06116.pdf. This includes an ODE function, (m::StableDynamics)(x) = begin if x == zero(x) return 0 end vx …

---

## [How to save optimiser state and the model of CGAN?](https://discourse.julialang.org/t/how-to-save-optimiser-state-and-the-model-of-cgan/67232)

<div class="topic-metadata">

**Author:** [@extremety1989](https://discourse.julialang.org/u/extremety1989)\
**Replies:** 0\
**Last updated:** [August 28, 2021, 4:07pm UTC](https://discourse.julialang.org/t/how-to-save-optimiser-state-and-the-model-of-cgan/67232 "2021-08-28T16:07:22Z")

</div>

link : https://github.com/FluxML/model-zoo/blob/master/vision/cdcgan\_mnist/cGAN\_mnist.jl i tried inside training loop: @save "gen-model-$(now()).bson" gen opt\_gen @save "dscr-model-$(now()).bson" dscr opt\_dscr ERROR: L…

---

## [How to use vertical GtkScale in GtkGrid with Gtk.jl](https://discourse.julialang.org/t/how-to-use-vertical-gtkscale-in-gtkgrid-with-gtk-jl/46752)

<div class="topic-metadata">

**Author:** [@kogad](https://discourse.julialang.org/u/kogad)\
**Replies:** 3\
**Last updated:** [August 28, 2021, 4:28pm UTC](https://discourse.julialang.org/t/how-to-use-vertical-gtkscale-in-gtkgrid-with-gtk-jl/46752 "2021-08-28T16:28:20Z")

</div>

Hi. I am trying to use a vertical slider (GtkScale) in a grid , but this code does not work well. using Gtk win = GtkWindow() c = GtkScale(false, -1:0.1:1) oc = GtkOrientable(c) GAccessor.orientation(oc, 1) b1 = GtkBu…

---

## [Solve ODE with many different initial conditions](https://discourse.julialang.org/t/solve-ode-with-many-different-initial-conditions/66384)

<div class="topic-metadata">

**Author:** [@hongchengni](https://discourse.julialang.org/u/hongchengni)\
**Replies:** 4\
**Last updated:** [August 28, 2021, 3:41pm UTC](https://discourse.julialang.org/t/solve-ode-with-many-different-initial-conditions/66384 "2021-08-28T15:41:20Z")

</div>

Hello friends, I have an ODE to solve with many different initial conditions varying in a nested loop. In my old code, I simply define the ODEProblem within the inner loop, which is simplest but slow. I suppose there ar…

---

## [Auto-release from VSCode (very cool): do I need to merge the branch by hand?](https://discourse.julialang.org/t/auto-release-from-vscode-very-cool-do-i-need-to-merge-the-branch-by-hand/67222)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 0\
**Last updated:** [August 28, 2021, 2:53pm UTC](https://discourse.julialang.org/t/auto-release-from-vscode-very-cool-do-i-need-to-merge-the-branch-by-hand/67222 "2021-08-28T14:53:05Z")

</div>

I am using the (very cool) “Tag new package version” feature of the Julia extension of VSCode (it was presented in the latest JuliaCon (I don’t like to tag people here). Thanks for that. I have just only one doubt: afte…

---

## [How to get current date and time?](https://discourse.julialang.org/t/how-to-get-current-date-and-time/67221)

<div class="topic-metadata">

**Author:** [@extremety1989](https://discourse.julialang.org/u/extremety1989)\
**Replies:** 1\
**Last updated:** [August 28, 2021, 2:45pm UTC](https://discourse.julialang.org/t/how-to-get-current-date-and-time/67221 "2021-08-28T14:45:19Z")

</div>

i tried this julia\> now() ERROR: UndefVarError: now not defined Stacktrace: \[1\] top-level scope @ REPL\[8\]:1

---

## [Obtaining the axis of a \`Colorbar\`](https://discourse.julialang.org/t/obtaining-the-axis-of-a-colorbar/67207)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 7\
**Last updated:** [August 28, 2021, 2:19pm UTC](https://discourse.julialang.org/t/obtaining-the-axis-of-a-colorbar/67207 "2021-08-28T14:19:11Z")

</div>

I am trying to implement a scroll-behaviour on a Colorbar placed in a gridlayout cell (e.g. fig\[1,2\]). However, I cannot find out, how to obtain the corresponding axis, which I need to register\_interaction!(ax) the scro…

---

## [How can I change a variable from one process to another if the two processes are on different machines?](https://discourse.julialang.org/t/how-can-i-change-a-variable-from-one-process-to-another-if-the-two-processes-are-on-different-machines/67199)

<div class="topic-metadata">

**Author:** [@Frisus95](https://discourse.julialang.org/u/Frisus95)\
**Replies:** 1\
**Last updated:** [August 28, 2021, 2:15pm UTC](https://discourse.julialang.org/t/how-can-i-change-a-variable-from-one-process-to-another-if-the-two-processes-are-on-different-machines/67199 "2021-08-28T14:15:05Z")

</div>

Goodmorning everyone! I have a pretty simple question. If I am using N processes (on a cluster, potentially with processes defined on different nodes) and I want to make sure that each process is able to modify a varia…

---

## [Transpose of an array of Strings](https://discourse.julialang.org/t/transpose-of-an-array-of-strings/40431)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 31\
**Last updated:** [August 28, 2021, 12:08pm UTC](https://discourse.julialang.org/t/transpose-of-an-array-of-strings/40431 "2021-08-28T12:08:48Z")

</div>

Consider the statement: a = \[1 2 3 4 \] and its transpose a', which generates a column vector. Now do the same with strings: b = \["a" "b" "c"\] and transpose it. I get the following error (which is very hard to believ…

---

## [How can I add to a plot without mutating it in Plots.jl?](https://discourse.julialang.org/t/how-can-i-add-to-a-plot-without-mutating-it-in-plots-jl/63911)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 6\
**Last updated:** [August 28, 2021, 11:14am UTC](https://discourse.julialang.org/t/how-can-i-add-to-a-plot-without-mutating-it-in-plots-jl/63911 "2021-08-28T11:14:36Z")

</div>

I would like to add to an existing plot p0 without mutating it. Currently I have to repeat code using Plots; xg = 0.01:0.01:10.0; p0 = plot(xg, sin, legend=:topleft) p0 = plot!(p0, xg, cos) p1 = plot!(p0, xg, log) p0…

---

## [Need help to translate this Pytorch part to Flux](https://discourse.julialang.org/t/need-help-to-translate-this-pytorch-part-to-flux/67032)

<div class="topic-metadata">

**Author:** [@extremety1989](https://discourse.julialang.org/u/extremety1989)\
**Replies:** 6\
**Last updated:** [August 26, 2021, 6:56pm UTC](https://discourse.julialang.org/t/need-help-to-translate-this-pytorch-part-to-flux/67032 "2021-08-26T18:56:30Z")

</div>

i already made some progress Pytorch code class ResidualBlock(nn.Module): def \_\_init\_\_(self, in\_channels, channels=32, residual\_beta=0.2): super().\_\_init\_\_() self.residual\_beta = residual\_beta …

---

## [Problem for adding new package:opening file](https://discourse.julialang.org/t/problem-for-adding-new-package-opening-file/67211)

<div class="topic-metadata">

**Author:** [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Replies:** 0\
**Last updated:** [August 28, 2021, 9:43am UTC](https://discourse.julialang.org/t/problem-for-adding-new-package-opening-file/67211 "2021-08-28T09:43:42Z")

</div>

I want to add a new package.But it shows me such error: (@JuliaPro\_v1.5.4-1) pkg\> add DecisionTree Updating registry at \`C:\\Users\\zlq\\.julia\\registries\\General\` ERROR: SystemError: opening file "C:\\\\Users\\\\zlq\\\\AppD…

---

## [How to add count legend on Bar graph using Gadfly?](https://discourse.julialang.org/t/how-to-add-count-legend-on-bar-graph-using-gadfly/67197)

<div class="topic-metadata">

**Author:** [@wakimchris](https://discourse.julialang.org/u/wakimchris)\
**Replies:** 3\
**Last updated:** [August 28, 2021, 8:42am UTC](https://discourse.julialang.org/t/how-to-add-count-legend-on-bar-graph-using-gadfly/67197 "2021-08-28T08:42:02Z")

</div>

I have created a DataFrame such as │ Row │ Gender\_Code │ N │ │ │ String │ Int64 │ ├─────┼─────────────┼───────┤ │ 1 │ M │ 1789 │ │ 2 │ F │ 205 │ When I applied on it Geom.bar, th…

---

## [ERROR: LoadError: LoadError: UndefVarError: n\_actions not defined](https://discourse.julialang.org/t/error-loaderror-loaderror-undefvarerror-n-actions-not-defined/67095)

<div class="topic-metadata">

**Author:** [@stajyerbob](https://discourse.julialang.org/u/stajyerbob)\
**Replies:** 9\
**Last updated:** [August 28, 2021, 8:29am UTC](https://discourse.julialang.org/t/error-loaderror-loaderror-undefvarerror-n-actions-not-defined/67095 "2021-08-28T08:29:16Z")

</div>

hey all, I tried to run SolveMDP.jl this code in julia1.1.1 on wsl ubuntu. I have installed all packages required but I had such an error:: “”–ERROR: LoadError: LoadError: UndefVarError: n\_actions not defined Stacktra…

---

## [What is the difference between the functions "big.", "big", "BigFloat"?](https://discourse.julialang.org/t/what-is-the-difference-between-the-functions-big-big-bigfloat/67205)

<div class="topic-metadata">

**Author:** [@qdmj](https://discourse.julialang.org/u/qdmj)\
**Replies:** 2\
**Last updated:** [August 28, 2021, 6:29am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-the-functions-big-big-bigfloat/67205 "2021-08-28T06:29:38Z")

</div>

What is the difference between the functions “big.”, “big”, “BigFloat”? By the way, is there a method to find descriptions of a function? It’s so troublesome to ask for every functions I haven’t seen.

---

## [Is preallocation possible for repeated calculation of trajectory of a discrete model (DynamicalSystems.jl)?](https://discourse.julialang.org/t/is-preallocation-possible-for-repeated-calculation-of-trajectory-of-a-discrete-model-dynamicalsystems-jl/67147)

<div class="topic-metadata">

**Author:** [@MathGuy](https://discourse.julialang.org/u/MathGuy)\
**Replies:** 3\
**Last updated:** [August 28, 2021, 6:26am UTC](https://discourse.julialang.org/t/is-preallocation-possible-for-repeated-calculation-of-trajectory-of-a-discrete-model-dynamicalsystems-jl/67147 "2021-08-28T06:26:58Z")

</div>

I need to analyze the following discrete model in r-k parametric space, function test\_difference\_eq(x,par,n) r, k = par a = 5.0; mu = 0.5; d = 0.2; dx = x\[1\]\*exp(r\*(1-x\[1\]/k)-x\[2\]/(a+x\[1\]^2)) dy = x\[2\]\*exp(m…

---

## [How to keep only first 20 rows in DataFrame?](https://discourse.julialang.org/t/how-to-keep-only-first-20-rows-in-dataframe/67206)

<div class="topic-metadata">

**Author:** [@wakimchris](https://discourse.julialang.org/u/wakimchris)\
**Replies:** 1\
**Last updated:** [August 28, 2021, 6:13am UTC](https://discourse.julialang.org/t/how-to-keep-only-first-20-rows-in-dataframe/67206 "2021-08-28T06:13:56Z")

</div>

How do I keep only first 20 rows in a DataFrame and export it to a new DataFrame variable? in one line

---

## [Truncated Poisson Distribution probs not adding up to one](https://discourse.julialang.org/t/truncated-poisson-distribution-probs-not-adding-up-to-one/61053)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 1\
**Last updated:** [August 28, 2021, 4:50am UTC](https://discourse.julialang.org/t/truncated-poisson-distribution-probs-not-adding-up-to-one/61053 "2021-08-28T04:50:39Z")

</div>

using Distributions λ = 2.0; #Poisson parameter zp = 0.4; #zero prob. dpoi = Poisson(λ) dzip = MixtureModel(\[Dirac(0.0), dpoi\], \[zp, 1.0-zp\]) #ZeroInflated ZIP dztp = Truncated(dpoi, 1, Inf) #Ze…

---

## [Reproducibility: Sad state of affairs indeed](https://discourse.julialang.org/t/reproducibility-sad-state-of-affairs-indeed/67200)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [August 28, 2021, 4:38am UTC](https://discourse.julialang.org/t/reproducibility-sad-state-of-affairs-indeed/67200 "2021-08-28T04:38:49Z")

</div>

This paper An invitation to reproducible computational research David L. Donoho Biostatistics , Volume 11, Issue 3, July 2010, Pages 385–388, https://doi.org/10.1093/biostatistics/kxq028 cites the so-called reproducib…

---

## [First n elements of array with Base.first](https://discourse.julialang.org/t/first-n-elements-of-array-with-base-first/28512)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 6\
**Last updated:** [August 28, 2021, 4:35am UTC](https://discourse.julialang.org/t/first-n-elements-of-array-with-base-first/28512 "2021-08-28T04:35:02Z")

</div>

Is there a built-in way to get the first n elements of an array, even if n exceeds the length of the array? This function demonstrates the desired behavior: function first\_n(a, n) n = min(n, length(a)) a\[1:n\] e…

---

## [It's running too long](https://discourse.julialang.org/t/its-running-too-long/66921)

<div class="topic-metadata">

**Author:** [@zhangsanle](https://discourse.julialang.org/u/zhangsanle)\
**Replies:** 6\
**Last updated:** [August 28, 2021, 2:07am UTC](https://discourse.julialang.org/t/its-running-too-long/66921 "2021-08-28T02:07:08Z")

</div>

I ran the following code for 7 hours without any results, how can I modify it? Thanks using Optim, LinearAlgebra, Statistics, Plots, QuantEcon, Distributions, Interpolations, NLsolve, Random, JuMP, GLPK import Ipopt β…

---

## [Error This intrinsic must be compiled to be called. Flux/Zygote](https://discourse.julialang.org/t/error-this-intrinsic-must-be-compiled-to-be-called-flux-zygote/66966)

<div class="topic-metadata">

**Author:** [@bgladman](https://discourse.julialang.org/u/bgladman)\
**Replies:** 5\
**Last updated:** [August 28, 2021, 1:10am UTC](https://discourse.julialang.org/t/error-this-intrinsic-must-be-compiled-to-be-called-flux-zygote/66966 "2021-08-28T01:10:33Z")

</div>

Hey all. I am trying to implement a neural network controller which emulates this example https://github.com/FluxML/Trebuchet.jl. In place of the ODE solver I am using a previously trained Flux model which outputs a si…

---

## [Are exceptions in Julia "Zero Cost"](https://discourse.julialang.org/t/are-exceptions-in-julia-zero-cost/38405)

<div class="topic-metadata">

**Author:** [@risingganymede](https://discourse.julialang.org/u/risingganymede)\
**Replies:** 12\
**Last updated:** [August 28, 2021, 1:02am UTC](https://discourse.julialang.org/t/are-exceptions-in-julia-zero-cost/38405 "2021-08-28T01:02:39Z")

</div>

In C++, there is no performance penalty for writing exception handlers provided that exceptions aren’t actually thrown (which should be “rare”). I was wondering if handling exceptions in Julia adds any overhead in the no…

---

## [MethodError: no method matching getindex(::Nothing, ::String)](https://discourse.julialang.org/t/methoderror-no-method-matching-getindex-nothing-string/67080)

<div class="topic-metadata">

**Author:** [@Sebastian\_Mena](https://discourse.julialang.org/u/Sebastian_Mena)\
**Replies:** 3\
**Last updated:** [August 28, 2021, 12:33am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-getindex-nothing-string/67080 "2021-08-28T00:33:10Z")

</div>

Hi, I’m trying to do an iteration, where I use a dictionary that gives me an array with values (“players”) and an array with weights (“weights”) with the same size, to make a sample. When I do it outside of iteration it …

---

## [AoG with\_theme](https://discourse.julialang.org/t/aog-with-theme/67149)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [August 28, 2021, 12:24am UTC](https://discourse.julialang.org/t/aog-with-theme/67149 "2021-08-28T00:24:35Z")

</div>

using AlgebraOfGraphics, CategoricalArrays, CairoMakie let n = 100 k = 13 d = data((x=rand(n), y=rand(n), c=rand(CategoricalArray(1:k, ordered=true), n))) v = visual(Scatter) m = mapping(:x, :y, color=:c) spec = d \* v \*…

---

## [Is resize! always in-place?](https://discourse.julialang.org/t/is-resize-always-in-place/67196)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 6\
**Last updated:** [August 27, 2021, 11:27pm UTC](https://discourse.julialang.org/t/is-resize-always-in-place/67196 "2021-08-27T23:27:12Z")

</div>

Following up from Implications of resize! If I have a vector of Float64, e.g. a = \[0.1, 0.2, 0.3\] and I call b = resize!(a, N) for some integer N, is there any sort of guarantee that a===b? That is, is it safe to si…

---

## [How lazy is too lazy? An exercise in pseudoinverses](https://discourse.julialang.org/t/how-lazy-is-too-lazy-an-exercise-in-pseudoinverses/67020)

<div class="topic-metadata">

**Author:** [@artkuo](https://discourse.julialang.org/u/artkuo)\
**Replies:** 4\
**Last updated:** [August 27, 2021, 11:16pm UTC](https://discourse.julialang.org/t/how-lazy-is-too-lazy-an-exercise-in-pseudoinverses/67020 "2021-08-27T23:16:07Z")

</div>

Inspired by this discussion, I worked up a self-education project to let a naive user type inv(A'A)A'b expecting to do a pseudoinverse by hand. But the package lazily avoids doing any inversion or matrix multiplication, …

---

## [Finding column indices of nonzero elements in a sparse matrix](https://discourse.julialang.org/t/finding-column-indices-of-nonzero-elements-in-a-sparse-matrix/67063)

<div class="topic-metadata">

**Author:** [@yewalenikhil65](https://discourse.julialang.org/u/yewalenikhil65)\
**Replies:** 5\
**Last updated:** [August 27, 2021, 9:00pm UTC](https://discourse.julialang.org/t/finding-column-indices-of-nonzero-elements-in-a-sparse-matrix/67063 "2021-08-27T21:00:10Z")

</div>

Is there any julia way to find column indices of nonzero elements in a sparse matrix ? I mean something that nzrange(A,j) does, but here j is the row index

---

## [DataFramesMeta computing weighted median within @by](https://discourse.julialang.org/t/dataframesmeta-computing-weighted-median-within-by/67111)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [August 27, 2021, 8:39pm UTC](https://discourse.julialang.org/t/dataframesmeta-computing-weighted-median-within-by/67111 "2021-08-27T20:39:12Z")

</div>

I’m struggling to figure this out. I have some data that look like this: using DataFrames using DataFramesMeta using StatsBase df = DataFrame(a=\[1,1,2,2,3,3,4,4,5,5,6,6\], b=rand(vcat(1:3, missing), 12), c=rand(10:50, 1…

---

## [\[CUDA\] Issue with cached\_memory() and Quadro RTX](https://discourse.julialang.org/t/cuda-issue-with-cached-memory-and-quadro-rtx/67102)

<div class="topic-metadata">

**Author:** [@RGerzaguet](https://discourse.julialang.org/u/RGerzaguet)\
**Replies:** 3\
**Last updated:** [August 27, 2021, 8:17pm UTC](https://discourse.julialang.org/t/cuda-issue-with-cached-memory-and-quadro-rtx/67102 "2021-08-27T20:17:48Z")

</div>

I have a new toy to play with (a Quadro RTX) and I want to use CUDA.jl with the GPU. I get a quite simple yet annoying issue associated to the function cached\_memory. The very simple MWE julia\> CUDA.versioninfo() CU…

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

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