# Specific Domains

**URL:** https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=397

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

**Page:** 398

---

## [MLJ - Error - Models support multitarget but measures do not?](https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091)

<div class="topic-metadata">

**Author:** [@diadora77](https://discourse.julialang.org/u/diadora77)\
**Replies:** 2\
**Last updated:** [January 10, 2021, 1:50pm UTC](https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091 "2021-01-10T13:50:22Z")

</div>

Hi- I’m relatively new to MLJ but have decent knowledge and experience using ScikitLearn. MLJ looks promising with more flexibility in model creation. In testing it out for my research, I’m struggling to get a basic mod…

---

## [Drawing text over pixels of an image](https://discourse.julialang.org/t/drawing-text-over-pixels-of-an-image/53040)

<div class="topic-metadata">

**Author:** [@claforte](https://discourse.julialang.org/u/claforte)\
**Replies:** 2\
**Last updated:** [January 10, 2021, 5:37am UTC](https://discourse.julialang.org/t/drawing-text-over-pixels-of-an-image/53040 "2021-01-10T05:37:23Z")

</div>

Hello Julia plotting experts, I want to annotate images by drawing text over the pixels of an image. This is to generate a lossless video where each frame shows an animated grid of tiles, each output by a different super…

---

## [Nonlinear fit with Flux](https://discourse.julialang.org/t/nonlinear-fit-with-flux/53075)

<div class="topic-metadata">

**Author:** [@edwinb-ai](https://discourse.julialang.org/u/edwinb-ai)\
**Replies:** 2\
**Last updated:** [January 10, 2021, 4:10am UTC](https://discourse.julialang.org/t/nonlinear-fit-with-flux/53075 "2021-01-10T04:10:43Z")

</div>

using Flux using Flux.Losses: mse using Flux.Data: DataLoader using Plots using Random gr() nonlinear(x) = sin(x) + sin(2 \* x) + 0.1f0 \* randn() function get\_data() points = 1000 xvals = collect(Float32, range…

---

## [Cuda cg + ilu?](https://discourse.julialang.org/t/cuda-cg-ilu/53069)

<div class="topic-metadata">

**Author:** [@Omega-xyZac](https://discourse.julialang.org/u/Omega-xyZac)\
**Replies:** 4\
**Last updated:** [January 9, 2021, 12:38am UTC](https://discourse.julialang.org/t/cuda-cg-ilu/53069 "2021-01-09T00:38:24Z")

</div>

Hi all, I’m looking to use a GPU CG method with an ILU preconditioner. I’m currently using a CPU CG method through IterativeSolvers and ILU through IncompleteLU.jl . The CG method from IterativeSolvers is easily extende…

---

## [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?

[Previous page](https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=396)

[Next page](https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=398)
