# Specific Domains

**URL:** https://discourse.julialang.org/c/domain/10.md?page=398

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

**Page:** 399

---

## [How to fit a normal approximation to data in Julia](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045)

<div class="topic-metadata">

**Author:** [@lesshaste](https://discourse.julialang.org/u/lesshaste)\
**Replies:** 21\
**Last updated:** [January 8, 2021, 7:32pm UTC](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045 "2021-01-08T19:32:19Z")

</div>

I have an unnormalized array of counts for a probability mass function (derived from sampling from the true function). The array should be indexed from 0. 12 is the number of times a 0 occurred in the sample. 199 is th…

---

## [Eigenvalue calculation differs between Julia and MATLAB](https://discourse.julialang.org/t/eigenvalue-calculation-differs-between-julia-and-matlab/31185)

<div class="topic-metadata">

**Author:** [@ElectronicTeaCup](https://discourse.julialang.org/u/ElectronicTeaCup)\
**Replies:** 25\
**Last updated:** [January 8, 2021, 5:16pm UTC](https://discourse.julialang.org/t/eigenvalue-calculation-differs-between-julia-and-matlab/31185 "2021-01-08T17:16:24Z")

</div>

I am determining the eigenvectors of some matrices, however, the result appears a little different between Julia and MATLAB. I’m porting some code onto Julia and want the exact output as I would see in MATLAB/OCTAVE. Any…

---

## [Derivative with respect to specified element of a vector](https://discourse.julialang.org/t/derivative-with-respect-to-specified-element-of-a-vector/53045)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 2\
**Last updated:** [January 8, 2021, 3:34pm UTC](https://discourse.julialang.org/t/derivative-with-respect-to-specified-element-of-a-vector/53045 "2021-01-08T15:34:58Z")

</div>

For example, I have the following function function test\_fun(state) x, y = state # 2 values \[x\*y^2\] end state = \[2,3\] test\_fun(state) I’d like to find the mixed derivative \\frac{d^2f}{dxdy} for vector case. I…

---

## [Adding (simple) user-defined functions causes significant slowdown in JuMP + Ipopt](https://discourse.julialang.org/t/adding-simple-user-defined-functions-causes-significant-slowdown-in-jump-ipopt/52971)

<div class="topic-metadata">

**Author:** [@boranzhao](https://discourse.julialang.org/u/boranzhao)\
**Replies:** 4\
**Last updated:** [January 8, 2021, 2:17pm UTC](https://discourse.julialang.org/t/adding-simple-user-defined-functions-causes-significant-slowdown-in-jump-ipopt/52971 "2021-01-08T14:17:57Z")

</div>

Hello, I created a nonlinear programming problem (for model predictive control) using JuMP, and solved it using Ipopt. However, I found that, if I included an (even very simple) user-defined function in the defining th…

---

## [Gradient of NN with respect to inputs](https://discourse.julialang.org/t/gradient-of-nn-with-respect-to-inputs/53037)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 1\
**Last updated:** [January 8, 2021, 1:21pm UTC](https://discourse.julialang.org/t/gradient-of-nn-with-respect-to-inputs/53037 "2021-01-08T13:21:46Z")

</div>

I want to take a gradient of NN but get the error MethodError: no method matching extract\_gradient!(::Type{ForwardDiff.Tag{Chain{Tuple{Dense{typeof(relu),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{F…

---

## [Lack of stable PostgreSQL-communication a major showstopper](https://discourse.julialang.org/t/lack-of-stable-postgresql-communication-a-major-showstopper/6934)

<div class="topic-metadata">

**Author:** [@johann.spies](https://discourse.julialang.org/u/johann.spies)\
**Replies:** 33\
**Last updated:** [January 8, 2021, 5:48am UTC](https://discourse.julialang.org/t/lack-of-stable-postgresql-communication-a-major-showstopper/6934 "2021-01-08T05:48:37Z")

</div>

I am beginning to enjoy Julia and actually succeeded in doing some useful stuff as I learn the language. I was hoping to replace what I am presently doing in Python with Julia. But I do a lot of database work and needs…

---

## [Has Moderna used Pumas AI for mRNA modeling and simulation?](https://discourse.julialang.org/t/has-moderna-used-pumas-ai-for-mrna-modeling-and-simulation/53004)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 1\
**Last updated:** [January 7, 2021, 10:57pm UTC](https://discourse.julialang.org/t/has-moderna-used-pumas-ai-for-mrna-modeling-and-simulation/53004 "2021-01-07T22:57:56Z")

</div>

A few days ago, I saw a Julia related tweet announcing that Pumas AI was involved in modeling and simulating Moderna’s mRNA. In a discussion with a friend about Julia vs Python I told him this news, but when I was aske…

---

## [Early stopping with Optim when the validation loss increases](https://discourse.julialang.org/t/early-stopping-with-optim-when-the-validation-loss-increases/53008)

<div class="topic-metadata">

**Author:** [@sobhan](https://discourse.julialang.org/u/sobhan)\
**Replies:** 1\
**Last updated:** [January 7, 2021, 10:17pm UTC](https://discourse.julialang.org/t/early-stopping-with-optim-when-the-validation-loss-increases/53008 "2021-01-07T22:17:56Z")

</div>

I’m using Optim.jl to train a model but it keeps overfiting. is there nice way of implementing a early stopping callback that has the current x? I tried setting the callback in Optim.Options but i only get the iteration…

---

## [\[DiffEqFlux.jl\] DimensionMismatch("array could not be broadcast to match destination")](https://discourse.julialang.org/t/diffeqflux-jl-dimensionmismatch-array-could-not-be-broadcast-to-match-destination/52992)

<div class="topic-metadata">

**Author:** [@vkv](https://discourse.julialang.org/u/vkv)\
**Replies:** 0\
**Last updated:** [January 7, 2021, 2:14pm UTC](https://discourse.julialang.org/t/diffeqflux-jl-dimensionmismatch-array-could-not-be-broadcast-to-match-destination/52992 "2021-01-07T14:14:21Z")

</div>

I’m trying to train a NeuralODE model on the MNIST dataset. When I take the gradient of loss function I get the DimensionMismatch error. using DiffEqFlux, OrdinaryDiffEq, Flux, NNlib, MLDataUtils, Printf using Flux: log…

---

## [Gauss-Legendre Quadrature performance](https://discourse.julialang.org/t/gauss-legendre-quadrature-performance/52958)

<div class="topic-metadata">

**Author:** [@Nellatur](https://discourse.julialang.org/u/Nellatur)\
**Replies:** 5\
**Last updated:** [January 7, 2021, 12:26pm UTC](https://discourse.julialang.org/t/gauss-legendre-quadrature-performance/52958 "2021-01-07T12:26:34Z")

</div>

Hi, I found a benchmark set with Julia and other languages at https://modelingguru.nasa.gov/docs/DOC-2676 It seems that the Gauss-Legendre Quadrature case Julia is slower than Python :frowning: I also found GitHub - …

---

## [Quadratic Programming with CPLEX and JuMP](https://discourse.julialang.org/t/quadratic-programming-with-cplex-and-jump/52950)

<div class="topic-metadata">

**Author:** [@ahmadreza-marandi](https://discourse.julialang.org/u/ahmadreza-marandi)\
**Replies:** 4\
**Last updated:** [January 7, 2021, 7:35am UTC](https://discourse.julialang.org/t/quadratic-programming-with-cplex-and-jump/52950 "2021-01-07T07:35:22Z")

</div>

It has been a while that CPLEX can solve nonconvex quadratic programming problems. But I am wondering if that has been considered in JuMP. The reason I am asking is that I coded the following: Q=\[-50.0 0.0 0.0 …

---

## [Relaxing binary variable](https://discourse.julialang.org/t/relaxing-binary-variable/52965)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 4\
**Last updated:** [January 7, 2021, 12:22am UTC](https://discourse.julialang.org/t/relaxing-binary-variable/52965 "2021-01-07T00:22:52Z")

</div>

In a model, I want to relax one binary variable. relax\_integrality(model) relaxes all variables of the model, so I think the right way to go will be to use unset\_binary as shown in the example below. model = Model() @v…

---

## [Tensor contration efficiency](https://discourse.julialang.org/t/tensor-contration-efficiency/52897)

<div class="topic-metadata">

**Author:** [@Nellatur](https://discourse.julialang.org/u/Nellatur)\
**Replies:** 4\
**Last updated:** [January 6, 2021, 7:35pm UTC](https://discourse.julialang.org/t/tensor-contration-efficiency/52897 "2021-01-06T19:35:21Z")

</div>

I saw some benchmark between NumPy and BLAS from C++ regarding matrix-matrix multiplication (a special case of tensor contraction) https://stackoverflow.com/questions/7596612/benchmarking-python-vs-c-using-blas-and-nump…

---

## [\[ANN\] Latin hypercube on MLJTuning](https://discourse.julialang.org/t/ann-latin-hypercube-on-mljtuning/52954)

<div class="topic-metadata">

**Author:** [@ludoro](https://discourse.julialang.org/u/ludoro)\
**Replies:** 0\
**Last updated:** [January 6, 2021, 6:05pm UTC](https://discourse.julialang.org/t/ann-latin-hypercube-on-mljtuning/52954 "2021-01-06T18:05:49Z")

</div>

Hello everyone! Just a quick announcement. MLJTuning now has a new tuning strategy: Latin Hypercube.:tada: It will be live when https://github.com/JuliaRegistries/General/pull/27394 gets merged. You can take a look at th…

---

## [How to define an optimizer package?](https://discourse.julialang.org/t/how-to-define-an-optimizer-package/51534)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 6\
**Last updated:** [January 6, 2021, 5:38pm UTC](https://discourse.julialang.org/t/how-to-define-an-optimizer-package/51534 "2021-01-06T17:38:32Z")

</div>

Whenever I try to compile the solver declaration the following error appears using JuMP, JuMPeR, Cbc, MathOptInterface ModelD = Model(with\_optimizer(Cbc.Optimizer)) Error message: UndefVarError: with\_optimizer not defin…

---

## [Mesh3D Only Plotting Half](https://discourse.julialang.org/t/mesh3d-only-plotting-half/52760)

<div class="topic-metadata">

**Author:** [@Nkrause](https://discourse.julialang.org/u/Nkrause)\
**Replies:** 15\
**Last updated:** [January 6, 2021, 3:35pm UTC](https://discourse.julialang.org/t/mesh3d-only-plotting-half/52760 "2021-01-06T15:35:44Z")

</div>

Hello, I’m trying to plot a 3d surface. I’ve used a marching cubes algorithm to generate a tuple of points. When I plot them in scatter() I get the following image, which is what I want and expect. scatter(\[a for (a,…

---

## [Why is statistics so difficult?](https://discourse.julialang.org/t/why-is-statistics-so-difficult/52416)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 40\
**Last updated:** [January 6, 2021, 1:33pm UTC](https://discourse.julialang.org/t/why-is-statistics-so-difficult/52416 "2021-01-06T13:33:50Z")

</div>

Hi all! I see a few very interesting discussions going on on this forum, and would like to ask for your opinions on the difficulty of statistics. I see many people hanging around here with much experience with stats, and…

---

## [Finding index and value of largest two elements in a CuArray](https://discourse.julialang.org/t/finding-index-and-value-of-largest-two-elements-in-a-cuarray/52110)

<div class="topic-metadata">

**Author:** [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Replies:** 11\
**Last updated:** [January 5, 2021, 4:36pm UTC](https://discourse.julialang.org/t/finding-index-and-value-of-largest-two-elements-in-a-cuarray/52110 "2021-01-05T16:36:24Z")

</div>

I need to find the indices and values of the two largest elements in a 2D array. I whipped up a foldl-based solution for the CPU that’s much faster than Base.findmax and Base.partialsortperm, but it runs like molasses on…

---

## [Problem using NLopt in JuMP model](https://discourse.julialang.org/t/problem-using-nlopt-in-jump-model/52499)

<div class="topic-metadata">

**Author:** [@Emmanouil\_Bakirtzis](https://discourse.julialang.org/u/Emmanouil_Bakirtzis)\
**Replies:** 11\
**Last updated:** [January 5, 2021, 2:55pm UTC](https://discourse.julialang.org/t/problem-using-nlopt-in-jump-model/52499 "2021-01-05T14:55:23Z")

</div>

Hi, I am trying to create a JuMP model using NLopt solver in Julia 1.5.3 using JuMP using NLopt model = Model(NLopt.Optimizer) but I get the following error ERROR: UndefVarError: Optimizer not defined Stacktrace: \[…

---

## [Playing with live plots in Pluto](https://discourse.julialang.org/t/playing-with-live-plots-in-pluto/44062)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 1:29pm UTC](https://discourse.julialang.org/t/playing-with-live-plots-in-pluto/44062 "2021-01-05T13:29:33Z")

</div>

I’m playing with live plotting using Pluto.jl. I have a simple plot updating at about 20 fps depending on what my computer is doing. I’m curious if anyone else is trying this sort of thing and if there are ways to get be…

---

## [Use of static array in a kernel function](https://discourse.julialang.org/t/use-of-static-array-in-a-kernel-function/52852)

<div class="topic-metadata">

**Author:** [@youngdae](https://discourse.julialang.org/u/youngdae)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 11:12pm UTC](https://discourse.julialang.org/t/use-of-static-array-in-a-kernel-function/52852 "2021-01-04T23:12:11Z")

</div>

Can I use StaticArrays in a kernel function? I wanted to use registers allocated for each thread. I thought that SVector would do that for me so I tried the following simple function. But, it says the kernel is returning…

---

## [List comprehension and integration of a function](https://discourse.julialang.org/t/list-comprehension-and-integration-of-a-function/52747)

<div class="topic-metadata">

**Author:** [@Nkrause](https://discourse.julialang.org/u/Nkrause)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 5:15pm UTC](https://discourse.julialang.org/t/list-comprehension-and-integration-of-a-function/52747 "2021-01-04T17:15:24Z")

</div>

I’m currently attempting to integrate a function in Julia using QuadGK() of the following form. It’s computing the potential of a ring of charge in space. \\phi=\\int\_0^{2\\pi} \\frac{1}{\\sqrt{(x-cos(t))^2+(y-sin(t))^2+z^2)…

---

## [Overcoming Slow Scalar Operations on GPU Arrays](https://discourse.julialang.org/t/overcoming-slow-scalar-operations-on-gpu-arrays/49554)

<div class="topic-metadata">

**Author:** [@sazio](https://discourse.julialang.org/u/sazio)\
**Replies:** 19\
**Last updated:** [January 4, 2021, 5:00pm UTC](https://discourse.julialang.org/t/overcoming-slow-scalar-operations-on-gpu-arrays/49554 "2021-01-04T17:00:29Z")

</div>

Hi all, I’ve been trying to exploit GPU capabilities for solving a NeuralPDE with GalacticOptim.solve, but I’ve been stumbling into a problem related to scalar operations on GPU arrays. In line 123 I use the |\> gpu ope…

---

## [Turing, Inexacterror for DiscreteUniform distribution, with NUTS sampler](https://discourse.julialang.org/t/turing-inexacterror-for-discreteuniform-distribution-with-nuts-sampler/52820)

<div class="topic-metadata">

**Author:** [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 1:05pm UTC](https://discourse.julialang.org/t/turing-inexacterror-for-discreteuniform-distribution-with-nuts-sampler/52820 "2021-01-04T13:05:47Z")

</div>

First off, thanks so much to everyone involved in making Turing and Julia great! Can’t stress enough how cool Turing is. Also, apologies if my question is not formatted correctly. I’v been getting the same inexact error…

---

## [NLsolve and OffsetArrays](https://discourse.julialang.org/t/nlsolve-and-offsetarrays/52740)

<div class="topic-metadata">

**Author:** [@cricci](https://discourse.julialang.org/u/cricci)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 12:45pm UTC](https://discourse.julialang.org/t/nlsolve-and-offsetarrays/52740 "2021-01-04T12:45:42Z")

</div>

Does the package NLsolve support the use of OffsetArrays? It looks to me it does not. using NLsolve using OffsetArrays function f!(F,x) F\[1\] = 3\*x\[1\]-cos(x\[2\]\*x\[3\])-1/2 F\[2\] = x\[1\]^2-81\*(x\[2\]+0.1)^2+sin(x\[3\])…

---

## [JuMP: allunique as a constraint?](https://discourse.julialang.org/t/jump-allunique-as-a-constraint/9569)

<div class="topic-metadata">

**Author:** [@yoeljacobsen](https://discourse.julialang.org/u/yoeljacobsen)\
**Replies:** 7\
**Last updated:** [January 4, 2021, 11:01am UTC](https://discourse.julialang.org/t/jump-allunique-as-a-constraint/9569 "2021-01-04T11:01:51Z")

</div>

How may I write a constraint for a list of variables requiring all to have unique integer values?

---

## [RNN Not learning](https://discourse.julialang.org/t/rnn-not-learning/51686)

<div class="topic-metadata">

**Author:** [@Emilio4d46](https://discourse.julialang.org/u/Emilio4d46)\
**Replies:** 9\
**Last updated:** [January 4, 2021, 9:46am UTC](https://discourse.julialang.org/t/rnn-not-learning/51686 "2021-01-04T09:46:32Z")

</div>

I have been trying to build an RNN in Julia using Flux and it does not seem to converge or learn at all. The code is learning on a parsed Stanford Sentiment Treebank (i.e. An array of words and a sentiment score) Th…

---

## [@NLconstraint with a sum, array and scalar variables](https://discourse.julialang.org/t/nlconstraint-with-a-sum-array-and-scalar-variables/52710)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 8:47am UTC](https://discourse.julialang.org/t/nlconstraint-with-a-sum-array-and-scalar-variables/52710 "2021-01-04T08:47:18Z")

</div>

Hello and happy new year! Below is a toy problem. It deals with a mix of 4 chemicals. The quantities of the chemicals are given in the array xs. The temperature of the mix is the only unknow, subject to the constrai…

---

## [Meaning of Δ in different \`apply!\` methods is different in different Flux optimizers?](https://discourse.julialang.org/t/meaning-of-in-different-apply-methods-is-different-in-different-flux-optimizers/52811)

<div class="topic-metadata">

**Author:** [@gxyd](https://discourse.julialang.org/u/gxyd)\
**Replies:** 0\
**Last updated:** [January 4, 2021, 7:57am UTC](https://discourse.julialang.org/t/meaning-of-in-different-apply-methods-is-different-in-different-flux-optimizers/52811 "2021-01-04T07:57:08Z")

</div>

Hi, I want to understand the meaning of Δ used in different methods (i.e. for different optimizers) in Flux. For example: in Descent, the meaning of Δ seems to be: \[∂f/∂θᵢ\] i=1,2,3,… While looking at the meaning of Δ …

---

## [Map Performance with CuArrays](https://discourse.julialang.org/t/map-performance-with-cuarrays/33497)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 15\
**Last updated:** [January 4, 2021, 7:29am UTC](https://discourse.julialang.org/t/map-performance-with-cuarrays/33497 "2021-01-04T07:29:48Z")

</div>

I’m trying to benchmark different methods of calling the same in-place function on subsets of a large data block using CuArrays. I’m using fft as an example function because I can baseline against planning an fft over on…

[Previous page](https://discourse.julialang.org/c/domain/10.md?page=397)

[Next page](https://discourse.julialang.org/c/domain/10.md?page=399)
