Re: [julia-users] Multiple lines statement?
On Thu, May 28, 2015 at 6:08 PM, Christoph Ortner christophortn...@gmail.com wrote: Is there any chance for a debate whether or not to introduce a symbol for line-continuation? It could be optional. The reason I am asking is that I just wasted a day looking for a bug that was caused by an equivalent situation to the example below. Christoph On Sunday, 30 November 2014 11:55:20 UTC, Christoph Ortner wrote: I think that the standard in mathematical typesetting is to write 2 + 3 rather than 2 + 3 so personally I find the Matlab syntax easier to read. One of the very few choices Julia made that I am not so sure about. Christoph
Re: [julia-users] Multiple lines statement?
Sorry. Somehow the gmail hotkey got messed up... On Thu, May 28, 2015 at 6:08 PM, Christoph Ortner christophortn...@gmail.com wrote: Is there any chance for a debate whether or not to introduce a symbol for line-continuation? It could be optional. I would +1 on this. We can probably live without it but from time to time I find myself looking for it. The reason I am asking is that I just wasted a day looking for a bug that was caused by an equivalent situation to the example below. Christoph On Sunday, 30 November 2014 11:55:20 UTC, Christoph Ortner wrote: I think that the standard in mathematical typesetting is to write 2 + 3 rather than 2 + 3 so personally I find the Matlab syntax easier to read. One of the very few choices Julia made that I am not so sure about. Christoph
[julia-users] Re: Julia Summer of Code
What is this Moore Foundation? Are you talking about the Gordon and Betty Moore Foundation? (that's all that I could find that looked like it might fund a project on Google) Just what is required for a company to fund a Julia Summer of Code project? (I've been advocating that the startup I'm consulting for fund a student next summer... [assuming the company is going strong, which I think it will, and that Julia is going strong, ditto]). We've been talking about what things we could make some form of open source (MIT, non-commercial only, whatever...), and how we could contribute to the Julia community. On Friday, May 15, 2015 at 7:57:24 PM UTC+2, Viral Shah wrote: Folks, The Moore Foundation is generously funding us to allow for 6-8 Julia Summer of Code projects. Details will be published soon, but if you are interested, please mark your calendars and plan your projects. -viral
Re: [julia-users] `axis(:equal)` or `axis(:scaled)` with Gadfly
Hi Jonny, could you share where you found it, for anyone who runs across this in the future? On Thursday, May 28, 2015, jonny brooks jonnybrook...@gmail.com wrote: No worries, I found it On Wednesday, 25 June 2014 12:51:50 UTC+1, Tomas Lycken wrote: When plotting in e.g. PyPlot I can do e.g. axis(:equal) or axis(:scaled) (my favorite) to get a plot where the axes are scaled so that the distance 1 is equally long in the x and y direction on the resulting image, and e.g. the unit circle is actually a circle. Is there any way to do the same in Gadfly? The only way I’ve found to control the relative scaling of the axes is to set the absolute size of the plot, and (a lot of) trial and error I can find something that is at least close to what I need… // T
[julia-users] Re: Julia on Android (and/or the web) - a scientific calculator on steroids.. good for tablets
I hope my 2D/3D rendering efforts get somewhere and we will then be able to power GUI's and visualization on android. In theory, everything should just work out, as soon as Julia runs on android, and I extend OpenGL to OpenGL ES. At least that's what I hope... If things go really smooth, we might just need to wait for Vulkan, and the produced OpenGL code will just run on any mobile device. And if things go even better, Julia could compile directly to SPIR-V (Vulkans Intermediate Representation, which we could generate from LLVM IR). Like this, we could have ultimate speed even for mobile devices with very little hassle. All in all, if everything comes along really great, we might be able to use Julia as a foundation for a terrific, high performance, GUI/Visualization library, which runs everywhere LLVM can spit out assembly for. Am Donnerstag, 28. Mai 2015 16:17:08 UTC+2 schrieb Páll Haraldsson: I've noticed: I guess we can announce alpha support for arm in 0.4 as well. (and the other thread on Julia on ARM). Now, Android runs on x86 (already covered, then if you have that kind of device, no need to wait for ARM support), ARM, and MIPS (actually do not know of a single device that uses it..). I would like to know the most promising way to support Android and.. A. For Firefox OS and the web in general, and hybrid apps, compiling to JavaScript (or Dart and then to JavaScript) would be a possibility, with asm.js/Emscripten. B. Just making native Android apps is probably easier. Assuming the ARM CPU is solved, it seems easier. And iOS would be very similar.. But would not work for Firefox OS - not a priority for now, but the web in general would be nice.. B. seems more promising except for the tiny/non-existent MIPS problem.. Also better long term, for full Android framework support and full Julia support (concurrency/BLAS etc. that JavaScript would not handle). 1. Just getting Julia to work on Android is the first step. Just the REPL, wouldn't have to be Juno IDE etc. or GUI stuff. 2. You could to a lot with just the REPL and a real keyboard or just an alternative programmers virtual keyboard.. However, graphing would be nice, and what would be needed? What are the most promising GUI libraries already supported by Julia (or not..)? Say Qt, supported by Julia and Android. Would it just work? 3. Long term, making apps, even standalone (Julia supports that) with Julia. If GUIs work for graphing, is then really anything possible? I know Android/Java has a huge framework. Google is already supporting Android with Go (without any Java) as of version 1.4 and with Dart (for hybrid apps). For Go they have a framework problem going to support games at first. Some people are sceptical about Julia and games because of GC (I'm not so much). I note Go also has GC.. JavaCall.jl only works for JVM not Dalvik or ART. Would it be best to just use the native C support on Android or somehow go through Go? Anyone already tried to call Go from Julia? Rust is possible, but doesn't have GC. Go should be possible, just as Java, but have similar problems.. Do/could macros somehow help with supporting the full Android framework? Julia already has no overhead calling, could you generate bindings from automatically from some metadata and/or on the fly? This could be a cool pet project - anyone else working along these lines? Any reason plan B couldn't succeed relatively quickly? There are some ways to make apps *on* Android already, I think all crappy, Julia wouldn't be..? Thanks in advance, -- Palli.
Re: [julia-users] Re: Converting AbstractString to char with AWS julia v0.3 - 0.4
I'm using Ubuntu 14.04.1. As far as I can remember, I copied and pasted from the documentation I just linked to for juliareleases. I just ran sudo apt-get remove julia, and then reinstalled, definitely following the juliareleases instructions, and wound up with julia Version 0.4.0-dev+5043 (2015-05-27 15:36 UTC), again.
Re: [julia-users] Multiple lines statement?
Is there any chance for a debate whether or not to introduce a symbol for line-continuation? It could be optional. The reason I am asking is that I just wasted a day looking for a bug that was caused by an equivalent situation to the example below. Christoph On Sunday, 30 November 2014 11:55:20 UTC, Christoph Ortner wrote: I think that the standard in mathematical typesetting is to write 2 + 3 rather than 2 + 3 so personally I find the Matlab syntax easier to read. One of the very few choices Julia made that I am not so sure about. Christoph
Re: [julia-users] segmentation fault in a call to intrinsics
Stefan, Got it -- thanks. This is very helpful and actually it seems quite obvious that I was misunderstanding how the intrinsics work. The intended algorithm (for which this was the simplest condensed example that produced the segfault) constructs and manipulates values whose types belong to a finite set and can have various lengths that depend on the input itself, even though input and outputs to the algorithm alway have the same type. To implement this efficiently I've used @nif from Cartesian, but in essence it seems it's not just a matter of efficiency: for the code to be correct, I need to ensure the variable names and types are varying along each conditional in a way such that the use of intrinsics is valid regardless of the runtime branch. As far as the LLVM support for nonstandard integer sizes goes, yes I've found that is a little bit of a thicket. So far I've found that addition and valid nonzero logical shifts work, but multiplication and shufflevector are broken for such types, in quite serious ways that lead to nonsense results. The issues with multiplication are known but when I get around to it I mean to submit a bug report for shufflevector. However, I think most of the problems I've had with Julia are actually related to the misunderstanding mentioned above. Thanks very much again, Bryce On Thursday, May 28, 2015 at 12:51:44 PM UTC-4, Stefan Karpinski wrote: Even though the else clause doesn't run, the code generation for it does – that's what's throwing the error here. When you use intrinsics, you're not really operating on values, you're telling the code generator what code to emit. In this case, you're telling it to emit invalid code for the second branch – truncating a UInt64 to UInt144, which is, of course, impossible. You can get the effect you want by conditionally defining the zero method: if sizeof(UInt144) sizeof(UInt64) zero_B(::Type{UInt144}) = box(UInt144,zext_int(UInt144,unbox(UInt64,zero(UInt64 else zero_B(::Type{UInt144}) = box(UInt144,trunc_int(UInt144,unbox(UInt64,zero(UInt64 end I should warn you that while Julia supports custom bits types with strange sizes like 144, you are fairly likely to encounter code generation problems with LLVM here and there. We still have a fair number of workarounds for such bugs for 128-bit integer types. That said, it's a good exercise and we should submit upstream bug reports with LLVM to fix such issues. On Wed, May 27, 2015 at 7:28 PM, Bryce Corrigan cyber...@gmail.com javascript: wrote: Hi all, I wonder if anyone can spot an obvious problem with the function zero_B below, which produces a segfault, whereas zero_A does not. I understand that in many instances this task of converting to a bitstype is more safety completed with high-level Julia functionality like reinterpret or immutable wrappers. However, I'm working on a library that works directly with data byte-fields. With this kind of coding it seems inevitable that one runs into bugs (like the recent LLVM shift bug), but here I was unable either to figure out my coding mistake or to find any recent bug-reports matching this pattern. Thanks in advance for any clues...! Bryce import Base.Intrinsics: box, unbox, zext_int, trunc_int bitstype 144 UInt144 function zero_A(::Type{UInt144}) box(UInt144,zext_int(UInt144,unbox(UInt64,zero(UInt64 end function zero_B(::Type{UInt144}) if sizeof(UInt144) sizeof(UInt64) box(UInt144,zext_int(UInt144,unbox(UInt64,zero(UInt64 else box(UInt144,trunc_int(UInt144,unbox(UInt64,zero(UInt64 end end julia zero_A(UInt144) UInt144(0x) julia zero_B(UInt144) Assertion failed: (castIsValid(op, S, Ty) Invalid cast!), function Create, file Instructions.cpp, line 2290. signal (6): Abort trap: 6 __pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line) Abort trap: 6
Re: [julia-users] Re: Julia Summer of Code
What is this Moore Foundation? Are you talking about the Gordon and Betty Moore Foundation? (that's all that I could find that looked like it might fund a project on Google) Yes. Just what is required for a company to fund a Julia Summer of Code project? (I've been advocating that the startup I'm consulting for fund a student next summer... [assuming the company is going strong, which I think it will, and that Julia is going strong, ditto]). We've been talking about what things we could make some form of open source (MIT, non-commercial only, whatever...), and how we could contribute to the Julia community. Good to hear that they might be interested. Perhaps the easiest thing to do is to make a donation to Julia through NumFocus.
Re: [julia-users] Re: sparse Jacobian and/or coloring
Opened issue https://github.com/mlubin/ReverseDiffSparse.jl/issues/18 Tnx, M On Wed, 2015-05-27 at 23:34, Miles Lubin miles.lu...@gmail.com wrote: Hi Mauro, Could you open an issue on ReverseDiffSparse to continue this discussion? Miles On Wednesday, May 27, 2015 at 3:42:36 PM UTC-4, Mauro wrote: For an implicit ode/dae solver, I want to provide automatic computation of a sparse Jacobian, either through automatic differentiation or finite differences. So, for given a function f(y, ydot) I need to compute the Jacobian in the following form: J = df/dy + a* df/dydot ReverseDiffSparse seems to do most of this (although Hessians are symmetric) but I struggle to make sense of it. Given f and a sparsity pattern of J, is there an incantation to get df/dy and df/dydot? If I wanted to use the coloring of ReverseDiffSparse (or some other package) for finite differencing, how would I go about it? What function calls would give me a coloring of the colums? Thanks! Mauro
Re: [julia-users] Re: Sampling a Discrete Probability Distribution Using a Vector
Thanks a bundle everyone, I could not have hoped for a better set of answers. The Darts, Dice, and Coins page is excellent, the original papers are also very accessible, something that I have experienced with a lot of early Computer Science papers. In case anyone is interested in where Vose's Alias Method is implemented, please see the link to the StatsBase.jl source below: https://github.com/JuliaStats/StatsBase.jl/blob/2668b50a37ea968619a10e061b954a7240782d3b/src/sampling.jl#L358-L415 Thank you once again, Julians are always a friendly and helpful bunch. Pontus
Re: [julia-users] Re: Julia Summer of Code
A possible project on the UI side of things is expanding functionality in Escher.jl (https://github.com/shashi/Escher.jl) Escher is a work-in-progress declarative UI library which lets you make Web UIs in pure Julia. It works well with Reactive.jl to allow you to create interactive visualizations/dashboads. There are 2 possible projects that are suitable for a 3-month period of work. 1. Testing infrastructure and tests - this should involve using something like Selenium 2. Expanding the library to include: spreadsheets, Table lens, and/or anything else you think might be good to have in a Julia UI toolkit If you are interested, let me know, we can do a hangout at a suitable time and I will give you an overview of the package. It will be great if others can spread the word about this project if you have someone in mind who you think can help out here, especially since there is not much time left. @Brian, I don't understand what you mean by adding Elm-style FRP to Jupyter. Currently any Reactive.jl Signal can be shown in a Jupyter notebook and it will be re-rendered on update. On Thu, May 28, 2015 at 11:23 AM, Viral Shah vi...@mayin.org wrote: Please do ask everyone who is interested in participating to send their project description and mentors also to julia...@googlegroups.com The last date is June 1, after which we can take a call on how many proposals we have received and which ones to fund. -viral On Thu, May 28, 2015 at 10:16 AM, Jiahao Chen jia...@mit.edu wrote: Reposting from a question I got offline: IterativeSolvers.jl implements a basic GKL SVD, but it has not been tested for performance with distributed arrays. The project I have in mind will consist of benchmarking and rewriting any necessary parts for speed. Most of the work I foresee coming from improving the speed of parallel matrix-vector products, and particularly implementing linear algebra operations for sparse distributed matrices, which don't exist right now. There are also questions of how to deal with numerical stability issues and reorthogonalization, and how to design an implementation that allows users fine-grained control of reorthogonalization for speed-accuracy tradeoffs. Thanks, Jiahao Chen Research Scientist MIT CSAIL Thanks, Jiahao Chen Research Scientist MIT CSAIL On Thu, May 28, 2015 at 11:43 AM, Jiahao Chen jia...@mit.edu wrote: I'd be happy to mentor someone working on parallel linear algebra. The simplest thing to do that will have very high impact is to implement high performance iterative (Golub-Kahan-Lanczos) SVD, similar to what is implemented in PROPACK. I'm also interested in a randomized SVD version similar to what is described in Halko, Martinsson and Tropp, doi:10.1137/090771806. I'm sure there are plenty of ODE projects around, but I would like to see someone take up the implementation of geometric integrators in ODE.jl. Thanks, Jiahao Chen Research Scientist MIT CSAIL -- -viral
[julia-users] Re: Julia Summer of Code
On Monday, 25 May 2015 16:26:34 UTC+2, Shantanu Raj wrote: I am hoping to join JSOC to apply for the autoformat-tool http://julialang.org/gsoc/2015/#project-autoformat-tool project, it would be great to have one for Julia too. The project can eventually be extended to a Sublime Text/Atom plugin ala. GoSublime. I am looking for a mentor, I have the time to devote to the project. Though I am a beginner in Julia programming currently, but I can learn fast. I have worked a lot in Go, and I looked up the source for gofmt, seems reasonable. Anyone willing to mentor, please feel free to contact me, I'd be highly grateful - Shantanu I'd love to see a tool like that, hope you'll get in!
Re: [julia-users] Macros generating Functions
Like this: julia macro gf(n) quote function $(esc(n))() 1 end end end julia @gf foo foo (generic function with 1 method) julia foo() 1 On Thu, 2015-05-28 at 12:06, Vasudha Khandelwal vasudhakhandelw...@gmail.com wrote: Can I use macros to generate functions with names passed as argument to the macro?
[julia-users] matlab code to julia for image segmentation
Hi, I use matlab for image segmentation.I am currently trying to do the same in julia. How can regionproperties be implemented in julia to get the bounding box. How can this be done in julia? BW = imgHSV(:,:,1) 0.05 | imgHSV(:,:,1) 0.15; Regards
[julia-users] Macros generating Functions
Can I use macros to generate functions with names passed as argument to the macro?
Re: [julia-users] Re: Julia Summer of Code
I am interested in implementing Neural Network visualization for Mocha along the lines of https://github.com/ajtulloch/dnngraph or implementing some algorithms in the IterativeSolvers.jl roadmap depending on whether I will be able to find a mentor. Thanks, Siva. On Thursday, May 28, 2015 at 9:13:41 AM UTC+5:30, Jiahao Chen wrote: I'd be happy to mentor someone working on parallel linear algebra. The simplest thing to do that will have very high impact is to implement high performance iterative (Golub-Kahan-Lanczos) SVD, similar to what is implemented in PROPACK. I'm also interested in a randomized SVD version similar to what is described in Halko, Martinsson and Tropp, doi:10.1137/090771806. I'm sure there are plenty of ODE projects around, but I would like to see someone take up the implementation of geometric integrators in ODE.jl. Thanks, Jiahao Chen Research Scientist MIT CSAIL
[julia-users] Re: `axis(:equal)` or `axis(:scaled)` with Gadfly
Hi Tomas, I'd quite like to do the same thing. Did you find out how to do this? Jonny On Wednesday, 25 June 2014 12:51:50 UTC+1, Tomas Lycken wrote: When plotting in e.g. PyPlot I can do e.g. axis(:equal) or axis(:scaled) (my favorite) to get a plot where the axes are scaled so that the distance 1 is equally long in the x and y direction on the resulting image, and e.g. the unit circle is actually a circle. Is there any way to do the same in Gadfly? The only way I’ve found to control the relative scaling of the axes is to set the absolute size of the plot, and (a lot of) trial and error I can find something that is at least close to what I need… // T
Re: [julia-users] Re: Julia Summer of Code
You should certainly write to pluskid - Mocha's author. On Thu, May 28, 2015 at 9:35 AM, Siva Prasad Varma sivapva...@gmail.com wrote: I am interested in implementing Neural Network visualization for Mocha along the lines of https://github.com/ajtulloch/dnngraph or implementing some algorithms in the IterativeSolvers.jl roadmap depending on whether I will be able to find a mentor. Thanks, Siva. On Thursday, May 28, 2015 at 9:13:41 AM UTC+5:30, Jiahao Chen wrote: I'd be happy to mentor someone working on parallel linear algebra. The simplest thing to do that will have very high impact is to implement high performance iterative (Golub-Kahan-Lanczos) SVD, similar to what is implemented in PROPACK. I'm also interested in a randomized SVD version similar to what is described in Halko, Martinsson and Tropp, doi:10.1137/090771806. I'm sure there are plenty of ODE projects around, but I would like to see someone take up the implementation of geometric integrators in ODE.jl. Thanks, Jiahao Chen Research Scientist MIT CSAIL -- -viral
[julia-users] Re: option to return success flag in chol() and constructor for Triangular
You can use try/catch, e.g. julia try cholfact(A) catch e e.info end 1 In 0.3, you can construct a Triangular matrix with Triangular(B, :L) and in 0.4 with LowerTriangular(B). Den onsdag den 27. maj 2015 kl. 18.12.51 UTC-4 skrev Roy Wang: Is there an easy way to return the LAPACK success flag of Cholesky decompositions? I am currently calling (B,success_flag)=Base.LinAlg.LAPACK.potrf!(my_inputs) in order to do this. I suspect this is not a good way to do this. Is there a constructor for the Triangular type? I wish to make B into a Triangular type.
[julia-users] Julia on Android (and/or the web) - a scientific calculator on steroids.. good for tablets
I've noticed: I guess we can announce alpha support for arm in 0.4 as well. (and the other thread on Julia on ARM). Now, Android runs on x86 (already covered, then if you have that kind of device, no need to wait for ARM support), ARM, and MIPS (actually do not know of a single device that uses it..). I would like to know the most promising way to support Android and.. A. For Firefox OS and the web in general, and hybrid apps, compiling to JavaScript (or Dart and then to JavaScript) would be a possibility, with asm.js/Emscripten. B. Just making native Android apps is probably easier. Assuming the ARM CPU is solved, it seems easier. And iOS would be very similar.. But would not work for Firefox OS - not a priority for now, but the web in general would be nice.. B. seems more promising except for the tiny/non-existent MIPS problem.. Also better long term, for full Android framework support and full Julia support (concurrency/BLAS etc. that JavaScript would not handle). 1. Just getting Julia to work on Android is the first step. Just the REPL, wouldn't have to be Juno IDE etc. or GUI stuff. 2. You could to a lot with just the REPL and a real keyboard or just an alternative programmers virtual keyboard.. However, graphing would be nice, and what would be needed? What are the most promising GUI libraries already supported by Julia (or not..)? Say Qt, supported by Julia and Android. Would it just work? 3. Long term, making apps, even standalone (Julia supports that) with Julia. If GUIs work for graphing, is then really anything possible? I know Android/Java has a huge framework. Google is already supporting Android with Go (without any Java) as of version 1.4 and with Dart (for hybrid apps). For Go they have a framework problem going to support games at first. Some people are sceptical about Julia and games because of GC (I'm not so much). I note Go also has GC.. JavaCall.jl only works for JVM not Dalvik or ART. Would it be best to just use the native C support on Android or somehow go through Go? Anyone already tried to call Go from Julia? Rust is possible, but doesn't have GC. Go should be possible, just as Java, but have similar problems.. Do/could macros somehow help with supporting the full Android framework? Julia already has no overhead calling, could you generate bindings from automatically from some metadata and/or on the fly? This could be a cool pet project - anyone else working along these lines? Any reason plan B couldn't succeed relatively quickly? There are some ways to make apps *on* Android already, I think all crappy, Julia wouldn't be..? Thanks in advance, -- Palli.
[julia-users] Re: Documentation system
On Sunday, May 24, 2015 at 11:28:22 AM UTC-4, Yuri D'Elia wrote: But I keep thinking about that nicely formatted inline-math in ijulia while browsing documentation ;) In IJulia, Markdown is even more natural because Jupyter/IPython can natively display Markdown with inline LaTeX equations.
[julia-users] Re: Documentation system
On 05/28/2015 04:06 PM, Steven G. Johnson wrote: But I keep thinking about that nicely formatted inline-math in ijulia while browsing documentation ;) In IJulia, Markdown is even more natural because Jupyter/IPython can natively display Markdown with inline LaTeX equations. That's definitely nice to hear. I do appreciate markdown regular syntax for inline documentation. I guess I just need to use it more and see how it pans out.
Re: [julia-users] Re: Julia Summer of Code
Hi all, I'm happy to mentor things related to Mocha.jl (https://github.com/pluskid/Mocha.jl), deep learning library for Julia. There are several TODOs on my list but I had difficulty finding free time to do. You are also free to propose anything else that is related: 1. Visualization of the networks (e.g. produce a dot file that could be rendered by GraphViz to visualize the network nicely) 2. Provide an easy interface to do small scale experiments (e.g. define a model by giving something like [(512,:relu), (512,:relu), 10], and being able to train or predict with one function call without worrying about all the details of layer definition and solver, coffeebreaks, etc.) 3. Implement Recurrent Neural Networks, LSTM Best, Chiyuan On Thursday, May 28, 2015 at 9:24:37 AM UTC-4, Viral Shah wrote: You should certainly write to pluskid - Mocha's author. On Thu, May 28, 2015 at 9:35 AM, Siva Prasad Varma sivap...@gmail.com javascript: wrote: I am interested in implementing Neural Network visualization for Mocha along the lines of https://github.com/ajtulloch/dnngraph or implementing some algorithms in the IterativeSolvers.jl roadmap depending on whether I will be able to find a mentor. Thanks, Siva. On Thursday, May 28, 2015 at 9:13:41 AM UTC+5:30, Jiahao Chen wrote: I'd be happy to mentor someone working on parallel linear algebra. The simplest thing to do that will have very high impact is to implement high performance iterative (Golub-Kahan-Lanczos) SVD, similar to what is implemented in PROPACK. I'm also interested in a randomized SVD version similar to what is described in Halko, Martinsson and Tropp, doi:10.1137/090771806. I'm sure there are plenty of ODE projects around, but I would like to see someone take up the implementation of geometric integrators in ODE.jl. Thanks, Jiahao Chen Research Scientist MIT CSAIL -- -viral
Re: [julia-users] matlab code to julia for image segmentation
On Thursday, May 28, 2015 02:02:36 AM fshussa...@gmail.com wrote: I use matlab for image segmentation.I am currently trying to do the same in julia. How can regionproperties be implemented in julia to get the bounding box. If your image is binary (i.e., has Bool values), then an easy approach is to use m = any(img, dim) along with findfirst and findlast. How can this be done in julia? BW = imgHSV(:,:,1) 0.05 | imgHSV(:,:,1) 0.15; It's almost the same: you use . instead of . You may also need to call `separate`. There's quite a lot of help available at http://timholy.github.io/Images.jl/ Best, --Tim
Re: [julia-users] Parallelization of Recursive Calls on a Tree
I tried to forge the tree structure using a SharedArray, putting the nodes and its childs in specific positions in the matrix. However, the SharedArray only allows Bits Types as elements. For my purposes, it would be interesting to have a user defined type, with various attributes of diferent types, like Numbers, DataFrames etc. On Wednesday, May 27, 2015 at 8:40:03 PM UTC-3, Stefan Karpinski wrote: That could work, but that's an array, not a linked node structure as this question indicates. On Wed, May 27, 2015 at 7:32 PM, datnamer rtem...@gmail.com javascript: wrote: What about shared array? On Wednesday, May 27, 2015 at 6:03:46 PM UTC-4, Stefan Karpinski wrote: Since Julia doesn't at this point have shared memory parallelism, you can't do this. On Wed, May 27, 2015 at 4:28 PM, Diogo Gobira diog...@gmail.com wrote: What's the best (if it's possible) way to parallelize recursive calls on a recursive data structure, like a tree, allowing all the workers to update the nodes they received as parameter on the recursive function calls. My code is similar to this: function apply_simulation(node,data) #Do sometinhing with the root node do_something(node) for i=1:length(node.childs) # Call recursivelly on each child apply_simulation(node.child[i],data) end end I would like to use @parallel, as shown in the code bellow. Is it possible for my tree object be visible and writable for all workers? function apply_simulation(node,data) #Do something with the root node do_something(node, data) *@parallel* for i=1:length(node.childs) # Call recursivelly on each child apply_simulation(node.child[i],data) end end Thanks!
Re: [julia-users] Re: Converting AbstractString to char with AWS julia v0.3 - 0.4
Definitely added the juliareleases version and not julianightlies one? Which Ubuntu version? On May 28, 2015 08:19, Andrew B. Martin andrew.brown.mar...@gmail.com wrote: I followed the instructions for ubuntu here: http://julialang.org/downloads/platform.html.
[julia-users] Re: Converting AbstractString to char with AWS julia v0.3 - 0.4
I followed the instructions for ubuntu here: http://julialang.org/downloads/platform.html.
[julia-users] Re: `axis(:equal)` or `axis(:scaled)` with Gadfly
No worries, I found it On Wednesday, 25 June 2014 12:51:50 UTC+1, Tomas Lycken wrote: When plotting in e.g. PyPlot I can do e.g. axis(:equal) or axis(:scaled) (my favorite) to get a plot where the axes are scaled so that the distance 1 is equally long in the x and y direction on the resulting image, and e.g. the unit circle is actually a circle. Is there any way to do the same in Gadfly? The only way I’ve found to control the relative scaling of the axes is to set the absolute size of the plot, and (a lot of) trial and error I can find something that is at least close to what I need… // T
Re: [julia-users] Packing and Unpacking several Matrixes into flat vectors
Sorry to be late to the party, catching up with my mailing list backlog. On Thursday, May 14, 2015 at 2:03:27 AM UTC-7, Tim Holy wrote: On Wednesday, May 13, 2015 11:50:00 PM Lyndon White wrote: function unpack!(nn::NN, θ::Vector) W_e_len = length(nn.W_e) b_e_len = length(nn.b_e) W_d_len = length(nn.W_d) b_d_len = length(nn.b_d) W_e_shape = size(nn.W_e) W_d_shape = size(nn.W_d) nn.W_e = reshape(θ[1: W_e_len],W_e_shape) nn.b_e = θ[W_e_len+1: W_e_len+b_e_len] nn.W_d = reshape(θ[W_e_len+b_e_len+1: W_e_len+b_e_len+W_d_len],W_d_shape ) nn.b_d = θ[W_e_len+b_e_len+W_d_len+1: end] nn end function pack(nn::NN) pack(nn.W_e[:],nn.b_e, nn.W_d[:],nn.b_d[:]] _ end pack(∇W_e::Matrix{Float64}, ∇b_e::Vector{Float64}, ∇W_d::Matrix{Float64}, ∇ b_d::Vector{Float64}) [∇W_e[:], ∇b_e, ∇W_d[:], ∇b_d] end I have been using pretty much the same strategy, but I exploit Julia introspection a little bit to make things more generic under the assumption that all the weights, and only the weights, are `Array` fields of the model type. import Base: length function length(m::Model) len = 0 for n in fieldnames(m) issubtype(fieldtype(typeof(m), n), Array) || continue len += length(getfield(m, n)) end len end function flat!(v, m) v = zeros(length(m)) Δ = 0 for n in fieldnames(m) issubtype(fieldtype(typeof(m), n), Array) || continue x = getfield(m, n) for i in eachindex(x) Δ+= 1 v[Δ] = x[i] end end v end flat(m) = flat!(zeros(length(m)), m) function unflat!(m, v) Δ = 0 for n in fieldnames(m) issubtype(fieldtype(typeof(m), n), Array) || continue x = getfield(m, n) for i in eachindex(x) Δ+= 1 x[i] = v[Δ] end end m end Potentially I should create an iterator `eacharray`, but so far I have been too lazy to do it. On 14 May 2015 at 14:40, John Myles White johnmyleswh...@gmail.com wrote: In the long-term, the best way to do this will be to use SubArray and ReshapeArray. You'll allocate enough space for all parameters, then unpack them into separate objects when that helps. Agreed, when we move closer to attain Array Nirvana [1] (views in particular), this is exactly the direction I intend to go in. [1]: https://github.com/JuliaLang/julia/issues/7941 Pontus
Re: [julia-users] segmentation fault in a call to intrinsics
Even though the else clause doesn't run, the code generation for it does – that's what's throwing the error here. When you use intrinsics, you're not really operating on values, you're telling the code generator what code to emit. In this case, you're telling it to emit invalid code for the second branch – truncating a UInt64 to UInt144, which is, of course, impossible. You can get the effect you want by conditionally defining the zero method: if sizeof(UInt144) sizeof(UInt64) zero_B(::Type{UInt144}) = box(UInt144,zext_int(UInt144,unbox(UInt64,zero(UInt64 else zero_B(::Type{UInt144}) = box(UInt144,trunc_int(UInt144,unbox(UInt64,zero(UInt64 end I should warn you that while Julia supports custom bits types with strange sizes like 144, you are fairly likely to encounter code generation problems with LLVM here and there. We still have a fair number of workarounds for such bugs for 128-bit integer types. That said, it's a good exercise and we should submit upstream bug reports with LLVM to fix such issues. On Wed, May 27, 2015 at 7:28 PM, Bryce Corrigan cyberbr...@gmail.com wrote: Hi all, I wonder if anyone can spot an obvious problem with the function zero_B below, which produces a segfault, whereas zero_A does not. I understand that in many instances this task of converting to a bitstype is more safety completed with high-level Julia functionality like reinterpret or immutable wrappers. However, I'm working on a library that works directly with data byte-fields. With this kind of coding it seems inevitable that one runs into bugs (like the recent LLVM shift bug), but here I was unable either to figure out my coding mistake or to find any recent bug-reports matching this pattern. Thanks in advance for any clues...! Bryce import Base.Intrinsics: box, unbox, zext_int, trunc_int bitstype 144 UInt144 function zero_A(::Type{UInt144}) box(UInt144,zext_int(UInt144,unbox(UInt64,zero(UInt64 end function zero_B(::Type{UInt144}) if sizeof(UInt144) sizeof(UInt64) box(UInt144,zext_int(UInt144,unbox(UInt64,zero(UInt64 else box(UInt144,trunc_int(UInt144,unbox(UInt64,zero(UInt64 end end julia zero_A(UInt144) UInt144(0x) julia zero_B(UInt144) Assertion failed: (castIsValid(op, S, Ty) Invalid cast!), function Create, file Instructions.cpp, line 2290. signal (6): Abort trap: 6 __pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line) Abort trap: 6
Re: [julia-users] Parallelization of Recursive Calls on a Tree
That will not be possible to operate on in parallel until we had multithreading support. On Thu, May 28, 2015 at 10:42 AM, Diogo Gobira diogob...@gmail.com wrote: I tried to forge the tree structure using a SharedArray, putting the nodes and its childs in specific positions in the matrix. However, the SharedArray only allows Bits Types as elements. For my purposes, it would be interesting to have a user defined type, with various attributes of diferent types, like Numbers, DataFrames etc. On Wednesday, May 27, 2015 at 8:40:03 PM UTC-3, Stefan Karpinski wrote: That could work, but that's an array, not a linked node structure as this question indicates. On Wed, May 27, 2015 at 7:32 PM, datnamer rtem...@gmail.com wrote: What about shared array? On Wednesday, May 27, 2015 at 6:03:46 PM UTC-4, Stefan Karpinski wrote: Since Julia doesn't at this point have shared memory parallelism, you can't do this. On Wed, May 27, 2015 at 4:28 PM, Diogo Gobira diog...@gmail.com wrote: What's the best (if it's possible) way to parallelize recursive calls on a recursive data structure, like a tree, allowing all the workers to update the nodes they received as parameter on the recursive function calls. My code is similar to this: function apply_simulation(node,data) #Do sometinhing with the root node do_something(node) for i=1:length(node.childs) # Call recursivelly on each child apply_simulation(node.child[i],data) end end I would like to use @parallel, as shown in the code bellow. Is it possible for my tree object be visible and writable for all workers? function apply_simulation(node,data) #Do something with the root node do_something(node, data) *@parallel* for i=1:length(node.childs) # Call recursivelly on each child apply_simulation(node.child[i],data) end end Thanks!