# \#first-steps

**URL:** https://discourse.julialang.org/tag/first-steps/41.md?match_all_tags=true&page=3&tags%5B%5D=first-steps

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

**Page:** 4

---

## [Problem in @NLobjective](https://discourse.julialang.org/t/problem-in-nlobjective/33190)

<div class="topic-metadata">

**Author:** [@GiuliaM](https://discourse.julialang.org/u/GiuliaM)\
**Replies:** 2\
**Last updated:** [January 13, 2020, 10:22am UTC](https://discourse.julialang.org/t/problem-in-nlobjective/33190 "2020-01-13T10:22:00Z")

</div>

Hi everyone! I’m a new Julia user. I am using Julia 1.2 and JuMP v0.20.0 for some optimization problems. I have a constrained nonlinear optimization and I would like to define a nonlinear objective function composed b…

---

## [Writing simple kernel functions (EM algorithm)](https://discourse.julialang.org/t/writing-simple-kernel-functions-em-algorithm/24787)

<div class="topic-metadata">

**Author:** [@myroslav](https://discourse.julialang.org/u/myroslav)\
**Replies:** 7\
**Last updated:** [November 28, 2019, 2:39pm UTC](https://discourse.julialang.org/t/writing-simple-kernel-functions-em-algorithm/24787 "2019-11-28T14:39:12Z")

</div>

Hi everyone, I am trying to get my head around writing GPU kernels in Julia, would be great if someone could help me with my example. Without going into too many details, I am trying to run a simple EM (Expectation-Maxi…

---

## [Mmap problem with SharedArrays](https://discourse.julialang.org/t/mmap-problem-with-sharedarrays/31552)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 2\
**Last updated:** [November 27, 2019, 1:44pm UTC](https://discourse.julialang.org/t/mmap-problem-with-sharedarrays/31552 "2019-11-27T13:44:49Z")

</div>

Hello, I am confronting a very weird problem when parallelizing some function. I understand that I am supposed to post a MWE but I could not recreate the issue in a simple problem. @everywhere function simulSample(Profi…

---

## [How compute \`gradient.(f, w)\` on GPU?](https://discourse.julialang.org/t/how-compute-gradient-f-w-on-gpu/30916)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [November 16, 2019, 8:06am UTC](https://discourse.julialang.org/t/how-compute-gradient-f-w-on-gpu/30916 "2019-11-16T08:06:57Z")

</div>

I can’t seem to figure out how to use the CuArray to compute the gradient of the same function f at many points x. E.g. using Zygote:gradient f(x) = x^2 x = rand(100) gradient.(f, x) the above works fine becuase it’s…

---

## [Optimizing performance (newcomer from Matlab)](https://discourse.julialang.org/t/optimizing-performance-newcomer-from-matlab/30825)

<div class="topic-metadata">

**Author:** [@jonneguyt](https://discourse.julialang.org/u/jonneguyt)\
**Replies:** 19\
**Last updated:** [November 8, 2019, 5:47am UTC](https://discourse.julialang.org/t/optimizing-performance-newcomer-from-matlab/30825 "2019-11-08T05:47:17Z")

</div>

Hi all, I am encountering slower than hoped for performance in my usage of Julia (in comparison to Matlab). I am sure that my coding style is largely responsible for this, but would appreciate any pointers. I am calcul…

---

## [What's wrong with this Flux model definitin?](https://discourse.julialang.org/t/whats-wrong-with-this-flux-model-definitin/30816)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [November 7, 2019, 3:13am UTC](https://discourse.julialang.org/t/whats-wrong-with-this-flux-model-definitin/30816 "2019-11-07T03:13:57Z")

</div>

I am on the latest master branch of Flux.jl using Flux using CuArrays CuArrays.allowscalar(false) x = gpu(rand(Float32, 1\_000\_000, 2)) y = 2 .\* x + gpu(rand(Float32, 1\_000\_000)) w = gpu(rand(2, 1)) loss(x, y) = Flux.m…

---

## [DataFrames: removing columns with many missing values](https://discourse.julialang.org/t/dataframes-removing-columns-with-many-missing-values/29907)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 2\
**Last updated:** [October 14, 2019, 7:33pm UTC](https://discourse.julialang.org/t/dataframes-removing-columns-with-many-missing-values/29907 "2019-10-14T19:33:08Z")

</div>

How can I remove columns with more than 10% missing data from a DataFrame? In R it would be x\[, colMeans(is.na(x)) \< 0.1\]. Thanks!

---

## [Error "Package does not have LinearAlgebra in its dependencies" running \`Pkg.test\`](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763)

<div class="topic-metadata">

**Author:** [@riccardomurri](https://discourse.julialang.org/u/riccardomurri)\
**Replies:** 3\
**Last updated:** [October 13, 2019, 9:38pm UTC](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763 "2019-10-13T21:38:49Z")

</div>

Hello! I am trying to write my first Julia package (called “BEAM”), but keep getting an error when I run Pkg.test("BEAM"): (BEAM) pkg\> test BEAM Testing BEAM Resolving package versions... ERROR: LoadError: Argument…

---

## [Generate all subsets of a set](https://discourse.julialang.org/t/generate-all-subsets-of-a-set/12810)

<div class="topic-metadata">

**Author:** [@iin](https://discourse.julialang.org/u/iin)\
**Replies:** 13\
**Last updated:** [October 13, 2019, 1:23am UTC](https://discourse.julialang.org/t/generate-all-subsets-of-a-set/12810 "2019-10-13T01:23:18Z")

</div>

Hi, I’m very new in Julia, & I really need help to generate all subsets of a set. For example: I have a set \[1, 2, 3, 4, 5\], then I need to generate all subsets from it, such \[\[1,2\], \[1,3\], \[2,3\],…\[2,3,4\], …\[2,3,4,5\], e…

---

## [\]test DiffEqGPU errors with " unsupported call to the Julia runtime"](https://discourse.julialang.org/t/test-diffeqgpu-errors-with-unsupported-call-to-the-julia-runtime/28893)

<div class="topic-metadata">

**Author:** [@nilsbecker](https://discourse.julialang.org/u/nilsbecker)\
**Replies:** 19\
**Last updated:** [September 20, 2019, 2:39pm UTC](https://discourse.julialang.org/t/test-diffeqgpu-errors-with-unsupported-call-to-the-julia-runtime/28893 "2019-09-20T14:39:11Z")

</div>

hi, i’m trying to experiment with ODE solving on GPUs but can’t seem to get the packages running properly. this is on a machine with CUDA 9.0 installed and 4 Tesla K80 GPUs. i can install DiffEqGPU but the test fails as…

---

## [Review inefficient pipeline?](https://discourse.julialang.org/t/review-inefficient-pipeline/28215)

<div class="topic-metadata">

**Author:** [@danriggins](https://discourse.julialang.org/u/danriggins)\
**Replies:** 2\
**Last updated:** [September 5, 2019, 11:06pm UTC](https://discourse.julialang.org/t/review-inefficient-pipeline/28215 "2019-09-05T23:06:12Z")

</div>

Hi, I’m a new learner, trying to learn/practice data ingestion in Julia. I was wondering if anyone could review this pipeline I created to see if there’s a more efficient way to do it. I ultimately want a JuliaDB table, …

---

## [More basic Revise usage with module](https://discourse.julialang.org/t/more-basic-revise-usage-with-module/27517)

<div class="topic-metadata">

**Author:** [@pearlzli](https://discourse.julialang.org/u/pearlzli)\
**Replies:** 9\
**Last updated:** [August 15, 2019, 5:15pm UTC](https://discourse.julialang.org/t/more-basic-revise-usage-with-module/27517 "2019-08-15T17:15:53Z")

</div>

Hello, I’m having trouble getting Revise to track changes to my module. I have using Revise in my startup.jl, and I’ve checked that it is indeed being loaded on startup. I then try: (v1.1) pkg\> generate MyPackage Genera…

---

## [DiffEqFlux with time as additional input to Neural ODE](https://discourse.julialang.org/t/diffeqflux-with-time-as-additional-input-to-neural-ode/26456)

<div class="topic-metadata">

**Author:** [@Michael\_Struwig](https://discourse.julialang.org/u/Michael_Struwig)\
**Replies:** 7\
**Last updated:** [July 21, 2019, 3:41pm UTC](https://discourse.julialang.org/t/diffeqflux-with-time-as-additional-input-to-neural-ode/26456 "2019-07-21T15:41:17Z")

</div>

Hi! My academic or theoretical vocabulary isn’t extensive, so please excuse any lack of terminology on my part. Please point the correct terminology out to me, I’m more than happy to learn. I’ve been enjoying and follo…

---

## [SVD solve with CUSOLVER](https://discourse.julialang.org/t/svd-solve-with-cusolver/25130)

<div class="topic-metadata">

**Author:** [@Donut\_Meepo](https://discourse.julialang.org/u/Donut_Meepo)\
**Replies:** 2\
**Last updated:** [June 11, 2019, 3:37am UTC](https://discourse.julialang.org/t/svd-solve-with-cusolver/25130 "2019-06-11T03:37:55Z")

</div>

Hi, I am trying to do eigen decomposition using CUSOLVER. But it is slower than using CPU. My gpu is GeForce 1060 maybe simply just it is not good enough? I think I am not doing it right hope someone can help me. Thank …

---

## [Help me write ℒ](https://discourse.julialang.org/t/help-me-write/23840)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 4\
**Last updated:** [May 4, 2019, 1:06pm UTC](https://discourse.julialang.org/t/help-me-write/23840 "2019-05-04T13:06:24Z")

</div>

i need to use this character (ℒ), but i don’t know how to write this symbol using the \\ + tab combination, anyone?. adding to this question, how can i obtain the appropiate command to write a symbol if i have the symbol…

---

## [Is it possible to make \`Normal(mu, sigma)\` work for when \`mu\` and \`sigma\` are tracked arrays?](https://discourse.julialang.org/t/is-it-possible-to-make-normal-mu-sigma-work-for-when-mu-and-sigma-are-tracked-arrays/22616)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [April 1, 2019, 11:11pm UTC](https://discourse.julialang.org/t/is-it-possible-to-make-normal-mu-sigma-work-for-when-mu-and-sigma-are-tracked-arrays/22616 "2019-04-01T23:11:45Z")

</div>

I am trying to make some code where the parameters defined the distribution. This is done in variational auto-encoders (VAE). But I am doing something simpler, I am just trying to implement a maximum likelihood estimator…

---

## [Shape of data for sequence learning in Flux.jl?](https://discourse.julialang.org/t/shape-of-data-for-sequence-learning-in-flux-jl/20811)

<div class="topic-metadata">

**Author:** [@clemej](https://discourse.julialang.org/u/clemej)\
**Replies:** 1\
**Last updated:** [March 26, 2019, 5:43pm UTC](https://discourse.julialang.org/t/shape-of-data-for-sequence-learning-in-flux-jl/20811 "2019-03-26T17:43:12Z")

</div>

I’m teaching myself Julia and porting some Python/Keras code over to FluxML, and I’m having trouble shaping the data in Julia. The python keras code is (basically): model = Sequential() model.add(LSTM(9, input\_shape=(1…

---

## [How to reduce the number of DataFrames rows printed in IJulia?](https://discourse.julialang.org/t/how-to-reduce-the-number-of-dataframes-rows-printed-in-ijulia/21953)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [March 23, 2019, 10:32am UTC](https://discourse.julialang.org/t/how-to-reduce-the-number-of-dataframes-rows-printed-in-ijulia/21953 "2019-03-23T10:32:31Z")

</div>

I want to reduce the number of rows printed by default for a DataFrame in Jupyter. How do I do that?

---

## [How to use a color gradient when plotting different functions in the same plot?](https://discourse.julialang.org/t/how-to-use-a-color-gradient-when-plotting-different-functions-in-the-same-plot/22117)

<div class="topic-metadata">

**Author:** [@drarnau](https://discourse.julialang.org/u/drarnau)\
**Replies:** 2\
**Last updated:** [March 22, 2019, 1:01pm UTC](https://discourse.julialang.org/t/how-to-use-a-color-gradient-when-plotting-different-functions-in-the-same-plot/22117 "2019-03-22T13:01:59Z")

</div>

I have tried something like plot() for a = 1:5 f(x) = x^a plot!(f, -5, 5, palette = cgrad(:viridis)) end plot!() What I am looking for is that the colours of each plot reflect the idea that a increases. For ex…

---

## [How to obtain the number of rows in each group using DataFramesMeta?](https://discourse.julialang.org/t/how-to-obtain-the-number-of-rows-in-each-group-using-dataframesmeta/21955)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [March 17, 2019, 6:50am UTC](https://discourse.julialang.org/t/how-to-obtain-the-number-of-rows-in-each-group-using-dataframesmeta/21955 "2019-03-17T06:50:16Z")

</div>

using DataFrames, DataFramesMeta a = DataFrame(a = rand(1:10, 100)) @\> begin a @by(:a, count = length(:a)) end is there a more convenient function like R’s dplyr::n() which returns the number of rows? Or even, R…

---

## [Value Function Iteration on GPU](https://discourse.julialang.org/t/value-function-iteration-on-gpu/13774)

<div class="topic-metadata">

**Author:** [@myroslav](https://discourse.julialang.org/u/myroslav)\
**Replies:** 6\
**Last updated:** [March 9, 2019, 7:12pm UTC](https://discourse.julialang.org/t/value-function-iteration-on-gpu/13774 "2019-03-09T19:12:13Z")

</div>

Hi, I am trying to understand how to do the very basic Value Function Iteration in an Overlapping Generations Model using the GPU. So far it works well on the CPU, but I am starting to run into trouble once I increase t…

---

## [Why Julia machine learning is so unfriendly? Very "unsmooth" experience from foolish guy](https://discourse.julialang.org/t/why-julia-machine-learning-is-so-unfriendly-very-unsmooth-experience-from-foolish-guy/21174)

<div class="topic-metadata">

**Author:** [@kirtsar](https://discourse.julialang.org/u/kirtsar)\
**Replies:** 15\
**Last updated:** [March 3, 2019, 4:19pm UTC](https://discourse.julialang.org/t/why-julia-machine-learning-is-so-unfriendly-very-unsmooth-experience-from-foolish-guy/21174 "2019-03-03T16:19:01Z")

</div>

Ok, so let’s imagine that I’m a newcomer in a field of machine learning, and the very first task i want to do in Julia is something like knn-classifier. Nice! So let’s try to do it step by step, using all those cool libr…

---

## [Initializing Sparse Matrices with CuArrays.jl](https://discourse.julialang.org/t/initializing-sparse-matrices-with-cuarrays-jl/21062)

<div class="topic-metadata">

**Author:** [@carlomontec](https://discourse.julialang.org/u/carlomontec)\
**Replies:** 4\
**Last updated:** [February 22, 2019, 7:05am UTC](https://discourse.julialang.org/t/initializing-sparse-matrices-with-cuarrays-jl/21062 "2019-02-22T07:05:41Z")

</div>

Hello, total newbie with GPU computing here. I have seen that is possible to use sparse matrices with CuArrays.jl, but I have not found a way to initialize them. I tried to with the example described at https://github.…

---

## [A question about defining a function inside another using metaprogramming](https://discourse.julialang.org/t/a-question-about-defining-a-function-inside-another-using-metaprogramming/20905)

<div class="topic-metadata">

**Author:** [@pdenapo](https://discourse.julialang.org/u/pdenapo)\
**Replies:** 1\
**Last updated:** [February 17, 2019, 4:22pm UTC](https://discourse.julialang.org/t/a-question-about-defining-a-function-inside-another-using-metaprogramming/20905 "2019-02-17T16:22:44Z")

</div>

Consider the following code for defining a function from a symbolic expression, using the metaprogramming facilities of Julia: expression\_G = :(x^3) G = eval(:(x-\>$expression\_G)) println(G(3)) it works as expected an…

---

## [Help reading @code\_warntype output](https://discourse.julialang.org/t/help-reading-code-warntype-output/20832)

<div class="topic-metadata">

**Author:** [@natemcintosh](https://discourse.julialang.org/u/natemcintosh)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 7:20pm UTC](https://discourse.julialang.org/t/help-reading-code-warntype-output/20832 "2019-02-15T19:20:11Z")

</div>

I’m attempting to learn a bit about how to read the output of @code\_warntype If I have a function like function myGlob(pattern::Regex, to\_search::Vector{String})::Vector{String} """ Something similar to glob …

---

## [Precompile weirdness with my first package](https://discourse.julialang.org/t/precompile-weirdness-with-my-first-package/20664)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 4\
**Last updated:** [February 12, 2019, 10:52pm UTC](https://discourse.julialang.org/t/precompile-weirdness-with-my-first-package/20664 "2019-02-12T22:52:38Z")

</div>

I’ve built an energy system model using JuMP and am preparing to open-source it, so as a first step I converted it into a package (named “Supergrid” for now). This is my first package so I may have messed something up, b…

---

## [Please can you explain the use of get! and IdDict in optimisers.jl](https://discourse.julialang.org/t/please-can-you-explain-the-use-of-get-and-iddict-in-optimisers-jl/20685)

<div class="topic-metadata">

**Author:** [@murphyk](https://discourse.julialang.org/u/murphyk)\
**Replies:** 5\
**Last updated:** [February 12, 2019, 12:51am UTC](https://discourse.julialang.org/t/please-can-you-explain-the-use-of-get-and-iddict-in-optimisers-jl/20685 "2019-02-12T00:51:24Z")

</div>

I’m trying to understand the optimization code for momentum which reads function apply!(o::Momentum, x, Δ) η, ρ = o.eta, o.rho v = get!(o.velocity, x, zero(x))::typeof(x) @. v = ρ \* v - η \* Δ @. Δ = -v end I do…

---

## [Pipeline : from raw data to fitted model?](https://discourse.julialang.org/t/pipeline-from-raw-data-to-fitted-model/20477)

<div class="topic-metadata">

**Author:** [@kirtsar](https://discourse.julialang.org/u/kirtsar)\
**Replies:** 6\
**Last updated:** [February 6, 2019, 10:22pm UTC](https://discourse.julialang.org/t/pipeline-from-raw-data-to-fitted-model/20477 "2019-02-06T22:22:31Z")

</div>

Hello everyone! I’m a novice in machine learning domain. I’m interested in basic ML pipeline from raw dataframe with missing values and so on to the trained model. Is there any unified process of pipelining such method…

---

## [Slow insert at end of large array (Solved)](https://discourse.julialang.org/t/slow-insert-at-end-of-large-array-solved/20264)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 7\
**Last updated:** [January 30, 2019, 9:14am UTC](https://discourse.julialang.org/t/slow-insert-at-end-of-large-array-solved/20264 "2019-01-30T09:14:07Z")

</div>

Why is inserting an element at the end of an array (with enough room – as evidenced by the lack of allocations) so slow? julia\> a0 = repeat(\[1\], 10^9); julia\> @btime insert!(a,1,10^9 + 1) evals=1 setup=(a=sizehint!(dee…

---

## [What does \`Flux.@treelike\` do?](https://discourse.julialang.org/t/what-does-flux-treelike-do/19975)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [January 24, 2019, 3:24am UTC](https://discourse.julialang.org/t/what-does-flux-treelike-do/19975 "2019-01-24T03:24:12Z")

</div>

What does Flux.@treelike do? In Flux’s source code, I see a lot of Flux’s layers are defined and then @treelike is called. .E.g. @treelike Dense.

[Previous page](https://discourse.julialang.org/tag/first-steps/41.md?match_all_tags=true&page=2&tags%5B%5D=first-steps)

[Next page](https://discourse.julialang.org/tag/first-steps/41.md?match_all_tags=true&page=4&tags%5B%5D=first-steps)
