Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [julia]

Julia is a high-level dynamic programming language designed to address the requirements of high-performance numerical and scientific computing while also being effective for general purpose programming.

Filter by
Sorted by
Tagged with
1 vote
0 answers
21 views

convert GPS coordinates to C-SQUARES at any resolution

a C-Squares encoder in Julia. FYI, C-Squares is a geocoding algorithm that assigns GPS coordinates to a spatial grid with a chosen resolution. Its specifications is here: https://www.cmar.csiro.au/...
simplyPTA's user avatar
  • 191
1 vote
0 answers
124 views

Convolutional Neural Network (CNN) in Julia

I wrote an n-dimensional convolutional neural network from scratch in Julia (check out the GitLab repo or the GitHub repo). It implements the following layer types: ...
Andy Sukowski-Bang's user avatar
2 votes
1 answer
202 views

Write Julia struct to a C++ struct

For the following Julia code: ...
dearn44's user avatar
  • 165
1 vote
1 answer
91 views

Neural Network in Julia (Multilayer Perceptron)

I wrote a simple multilayer perceptron in Julia, which seems to work fine on different datasets, e.g. the MNIST dataset with a success rate of about 90% after a few seconds of training. But I would ...
Andy Sukowski-Bang's user avatar
1 vote
1 answer
303 views

Implementing a 1D Convolution SIMD Friendly in Julia

I want to implement a 1D convolution in Julia using the direct calculation since the conv() function in DSP.jl uses DFT (fft) ...
Royi's user avatar
  • 582
3 votes
0 answers
66 views

Entities with varied Movement polymorphic implementations in Julia

I have very basic principle. I have multiple types of entities with some shared functionality. Some of this functionality is highly customizable and you want to be able to swap it out even for a ...
K.H.'s user avatar
  • 2,668
3 votes
0 answers
80 views

Raytracing in Julia

This is my first project in julia. It is a raytracer based on spheres. ...
M472's user avatar
  • 366
0 votes
1 answer
59 views

streaming / low memory groupby in julia

I am working on a groupby-aggregation function that will work without RAM overflow issues. Essentially, I want it to run as fast as possible, while not necessarily loading the entire data structure ...
chase's user avatar
  • 123
4 votes
1 answer
184 views

Minimize memory allocations while calculating the matrix representation of a Hamiltonian

I am writing a script using Julia (calling my functions from the REPL) to compute the matrix representation of certain Hamiltonian. After I run my script I see that the memory allocations count is ...
Leo Flores's user avatar
2 votes
0 answers
53 views

Non-allocating k-nearest-neighbours between two matrices in Julia

I played around with some optimizations when answering this SO question. Sought is a function which given matrices x of size (m, l) and ...
phipsgabler's user avatar
4 votes
3 answers
221 views

Project Euler #12: find smallest triangular number with over 500 factors

My code in Julia, almost identical to the Python code (see below), runs in 4.6 s while the Python version runs in 2.4 s. Obviously there is a lot or room for improvement. ...
Maxwell's Daemon's user avatar
2 votes
2 answers
196 views

Sort three numbers

So, I wrote this function to sort three numbers in Julia. Any feedback on readability, performance, and Julian-ness would be appreciated. ...
Luapulu's user avatar
  • 333
1 vote
0 answers
141 views

How to make my 1D EM algorithm written in Julia faster?

I wrote this code that's supposed to implement a 1-dimensional (!) EM algorithm with k-means initialization: ...
ForceBru's user avatar
  • 455
2 votes
1 answer
165 views

Reducing allocations in arbitrary precision calculations with Julia

I am new to Julia and have only written in python before which is most likely also reflected by my coding style. Unfortunately, my applications require very high numerical precision which is why I am ...
Timo's user avatar
  • 143
5 votes
2 answers
346 views

Fast hamming distance function in Julia that returns a distance matrix

I would like to use Julia to compute the hamming distance on a very large dataset. I need to get back a distance matrix between rows in order to run further ...
giac's user avatar
  • 247
3 votes
1 answer
229 views

Discrete event simulation framework for discrete times in Julia

I would like to receive constructive feedback on my simulation framework (this is for my thesis work). I have no formal background in programming, and I am wondering if there is a more effective and ...
manuka's user avatar
  • 31
3 votes
1 answer
259 views

Parsing values from string into struct using match in Julia

My goal I am parsing from a string which contains token:value pairs into a type. Example: ...
Jessica Nowak's user avatar
2 votes
1 answer
161 views

Return n largest nonzero entries of an array

For something I'm working on, I need a function that takes in a one-dimensional array vec of integers and returns a boolean array of the same shape indicating where ...
Max's user avatar
  • 207
6 votes
1 answer
345 views

Speed of Python vs Julia for Game of Life. Why is Julia slow?

To compare the speed of Julia to Python+numba, I implemented Game of Life in both languages. For anyone who is not familiar with ...
Thomas's user avatar
  • 225
4 votes
2 answers
249 views

Solving 15Puzzle with Julia

Asking here instead of SO as suggested. I'm trying to use Julia to solve the common tile game 15 Puzzle using Julia using A* algorithm. I am quite new to the language and my style may seem very C like....
Gr3g-prog's user avatar
2 votes
1 answer
55 views

Restructuring loop logic and its effect on allocations

I came across in a code base # TODO this seems very clumsy to duplicate the loop code like this? so I figured I'd give it a shot as a learning exercise. I'd like ...
Andy's user avatar
  • 231
6 votes
0 answers
143 views

Julia set in Julia (and other fractals)

I've made the following to draw a series of zooming in images of a fractal. ...
Oscar Smith's user avatar
  • 3,597
2 votes
0 answers
88 views

Sampling and Reconstructing a signal in Julia

I am a newcomer to the Julia world, so I started trying to implement a very simple program: Sample a signal Reconstruct it (various ways, just rectangular for now) Plot it Everything is fine and '...
ntakouris's user avatar
  • 121
6 votes
0 answers
146 views

How to speed up simple linear algebra optimization probelm in Julia?

I implemented the LSDD changepoint detection method decribed in [1] in Julia, to see if I could make it faster than the existing python implementation [2], which is based on a grid search that looks ...
Johncowk's user avatar
  • 161
6 votes
1 answer
928 views

Optimizing my 2D Ising model code in Julia

I'm just starting to learn Julia, I work primarily in physics and am used to writing most of my code in Fortran90 and occasionally Python for Tensorflow (also Mathematica but that's less relevant). ...
Kai's user avatar
  • 161
2 votes
1 answer
50 views

Add optional distance range to function

I have a simple brute-force search function: ...
Seanny123's user avatar
  • 1,527
2 votes
1 answer
177 views

Time-series search with early stopping

I want to search for a pattern in a time-series while either ignoring the mean/shift/bias or the scale/standard deviation. Consequently, I've written two functions. The first function searches ...
Seanny123's user avatar
  • 1,527
1 vote
1 answer
95 views

Experience replay memory

I have just begun learning Julia. Here is an implementation of experience replay memory for use in a reinforcement learning algorithm. It is pretty simple, essentially a ring buffer with the following ...
Atuos's user avatar
  • 111
0 votes
1 answer
84 views

Building an equation [closed]

I've developed a function in the Julia language, using the SymEngine library, which builds an equation. This function works quite quickly, returning a lambdified ...
Leeloo's user avatar
  • 109
3 votes
1 answer
71 views

Bernstein polynomial type for quadratic clipping

I would like to implement a Bernstein polynomial class in Julia for learning purposes. The goal in the end is to implement the quadratic clipping algorithm from this paper. I am completely new to ...
mcocdawc's user avatar
  • 944
2 votes
2 answers
156 views

For names sake - Project Euler 22

Project Euler - 22 Names scores Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin ...
N3buchadnezzar's user avatar
3 votes
0 answers
280 views

Weighted logistic regression in Julia

I'm trying to estimate a weighted logistic regression as part of a bigger project. I have an implementation in Matlab2015b, but I wanted to give Julia a try to see if I could speed up the estimation ...
jvz's user avatar
  • 131
3 votes
0 answers
723 views

Parsing simple log files in Julia vs Python

I wrote a log parser in Python and Julia. The Python version takes about 8 seconds to process 350 files, while the Julia version takes about 8 seconds to compile, after which it takes over 20 seconds ...
TigerhawkT3's user avatar
3 votes
1 answer
94 views

Saving the values of all variabled declared in a block

Often when running exprimental code to empirically investigate an algorithm, you tweak a parameter, then rerun the code, and generate a bunch of saved models for various parameters. To make sure I ...
Frames Catherine White's user avatar
23 votes
5 answers
2k views

Benchmarks of various scientific programming languages for theoretical modelling

For a theoretical modelling course for biology students, I am trying to decide which would be the best technical programming language for doing evolutionary simulations in terms of elegance and ...
Tom Wenseleers's user avatar
4 votes
1 answer
1k views

Speeding up OpenCL matrix-vector multiplication

So I'd like to get a performance boost above and beyond standard Julia matrix-vector multiply, using my Intel HD Graphics 4000 1536 MB GPU, but I can't do better than an order of magnitude worse ...
Set's user avatar
  • 372
2 votes
1 answer
206 views

Recursively walk directories with a callback function

This code works, but I want to refine it: ...
dopatraman's user avatar
4 votes
1 answer
1k views

Sort Algorithms in Julia

Similar to this question here, I am trying to implement sort algorithms in Julia, as part of a package. The code for the implementation is as follows: ...
Dawny33's user avatar
  • 295
3 votes
2 answers
1k views

Search algorithms in julia

I've been trying to implement the basic search algorithms: Sequential search for ordered and unordered arrays and the binary search algorithms, as part of a package. So, this is the implementation: <...
Dawny33's user avatar
  • 295
4 votes
2 answers
243 views

Computing the double Integral using MonteCarlo techniques using Julia

I decided to try and learn Julia for doing scientific computing, and I decided to tackle the problem of finding $$ \int_{D_{\frac{1}{4}}} x^4 + y^2 dA $$ where \$ D_{\frac{1}{4}} \$ is the part of ...
David Cardozo's user avatar
5 votes
1 answer
169 views

Implementing cat function in Julia

I wanted to implement the cat function in Julia and I ran a few test cases but I am not sure if I am missing anything: ...
Jeremy Fisher's user avatar
4 votes
2 answers
186 views

Latent Dirichlet Allocation Posterior Inference

I have implemented Latent Dirichlet Allocation in Julia. Since the code is rather long, I copied the essential part here but the complete code can be found on GitHub. ...
Adham's user avatar
  • 53
5 votes
0 answers
169 views

Kernel density regression in Julia

Here is a naive implementation of a kernel density regression algorithm in Julia. The code works, but there is quite a bit of room for improvement though. First, there is not an optimal bandwidth ...
Vincent's user avatar
  • 561
2 votes
0 answers
34 views

Iterative procedure to get 3D coordinates from distance constraints

Imagine you have a series of n points randomly generated in a box in 3D space. You also have a list of distance bounds, e.g. points 5 and 3 should be between 1.0 and 2.0 Angstroms apart. There are ...
jgreener's user avatar
  • 153
5 votes
1 answer
611 views

Terry Feagin's 10th order explicit Runge-Kutta method

The following Julia code implements Terry Feagin's 10th order explicit Runge-Kutta method (a more accurate cousin of RK4). Though the structure of the code is quite simple (i.e. no cyclomatic ...
David Zhang's user avatar
2 votes
1 answer
764 views

Functions for outputting the rows and columns of a matrix

I often want to iterate either row-wise or column-wise though a matrix in Julia, so I've created a pair of functions to help: ...
Frames Catherine White's user avatar
8 votes
1 answer
226 views

Individuals reproduce and mutate

How can I improve the performance (in terms of computation time) of this code? ...
Remi.b's user avatar
  • 617
6 votes
2 answers
740 views

Julia RPN calculator algorithm ported from Python version

I've just finished the Reverse Polish Notation task in Julia from rosettacode.com by porting the existing Python code. There are only a few lines I don't get how to port: ...
HarmonicaMuse's user avatar
4 votes
1 answer
403 views

Neural Network in Julia

I am currently trying to implement a Neural Net in Julia with the goal of eventually implementing a stacked autoencoder. My code seems to work but I would appreciate any constructive criticism. If ...
Josh Greenhalgh's user avatar
2 votes
1 answer
251 views

Speed optimization for girth-counting algorithm

I have the following girth-counting algorithm on a large 0-1 matrix and I need to optimize it for speed: ...
AboAmmar's user avatar
  • 129