240 likes | 373 Views
Zurich Julia Users Group. Meetup 2 @Stamford Consultants – Meeting Room 2nd Floor 26th June 2014. Agenda. 18:00 – Arrival and warm-up Pizzas / drinks 18:45 Pre-Session Introduction / JuliaCon A short overview of the performance of Julia compared to MATLAB and R (Dominik)
E N D
Zurich Julia Users Group Meetup 2 @Stamford Consultants – Meeting Room 2nd Floor 26th June 2014
Agenda • 18:00 – Arrival andwarm-up • Pizzas / drinks • 18:45 Pre-Session • Introduction / JuliaCon • A short overview of the performance of Julia compared to MATLAB and R (Dominik) • 19:30 Session 1 on general aspects - comparison with R, Python etc., and Julia's relation w.r.t. Data Science (Malcolm) • 20:30 Session 2 one on more specific topics such as Big Data, NoSQL and parallelization (Malcolm)
JuliaCon – June 26 and27 in Chicago http://juliacon.org/ The first-ever Julia conference will take place June 26 and 27 (Thursday and Friday) at the University of Chicago Gleacher Center in Chicago, Illinois. Expect two days of cutting-edge technical talks, a chance to rub shoulders with Julia's creators, and a weekend in a city known for its beautiful lakefront and world-class architecture.
Julia Resources • The Julia Language • Julia (programminglanguage) - Wikipedia, thefreeencyclopedia • Julia Documentation — Julia Language 0.2.0 documentation • The Julia Manual — Julia Language 0.2.0 documentation • The Julia Standard Library — Julia Language 0.2.1 documentation • Available Packages — Julia Language 0.2.0 documentation • NoteworthyDifferencesfromotherLanguages — Julia Language 0.2.1 documentation • Julia Downloads • The Julia Blog • Julia Publications • Using Julia in theclassroom • JuliaCon 2014: June 26-27, Chicago, IL. • juliabloggers.com - A Julia Language Blog Aggregator • Learnjulia in Y Minutes • julia-dev - Google Groups • julia-users - Google Groups • (99+) julia-stats – Google Groups • (16) julia-opt – Google Groups • Lesezeichen verwalten
Julia - Performance Comparedto MATLAB, R , (andbitto Python)
Julia Comparedto MATLAB, R (and Python) • Functionscompared • RecursiveFibonacci • Parse Integer • Array Constructors • Smallestnumberdivisiableby all numbers of a factorial • Numericvectorsort • Slow piseries • Slow piseries, vectorized • Random matrixstatistics • Large randomnumbergenerationandmatrixmultiplication
Win 7 Pro, 32 bit Timings in seconds
Comparedto Python Fun With Just-In-Time Compiling: Julia, Python, R and pqR http://www.juliabloggers.com/fun-with-just-in-time-compiling-julia-python-r-and-pqr/ This problem is calculating the smallest number that is divisible by all of the numbers in a factorial. For example, for the numbers in 5!, 60 is the smallest number that is divisible by 2, 3, 4 and 5. functionsmallestdivisall(n::Int64) for i = 1:factorial(n) for j = 1:n if i % j !=0 break elseif j == n return i end end end end defsmallestdivisall(n): for i in xrange(1, math.factorial(n)+1): for j in xrange(1, n+1): if i % j != 0: break elif j == n: return i Python Julia Julia isabout 3-6 x fasterthan Python but…
… itisimportanttoknowofwhich Python versionwearetalkingabout!
Julia Benchmark (Table) C performance = 1.0, smallerisbetter
@timeit– A quick Look at Macros # using the macro @timeitfib(25)"fib" "Recursive fibonacci" # themacro macrotimeit(ex,name,desc,group...) quote t = zeros(ntrials) for i=0:ntrials e = @elapsed$(esc(ex)) if i > 0 # warm up on firstiteration t[i] = e end end @output_timingst$name$desc $group end end The expressiongetsevaluatedandtheelapsed time ismeasured an stored in e Skip thefirstmeasurebecauseitisalwayssloweras Julia hastoinitialisethe JIT first macro output_timings(t,name,desc,group) quote (… hided code …) elseifprint_output @printf"%s,%f\n" $name minimum($t) end gc() end end 1 2
Fast NumericComputationwith Julia • Devectorizeespressions – theoppositeto MATLAB • Mergecomputationsinto a singleloop • Write cache-friendlycode • Avoidcreatingarrays in loops • Use BLAS • Use a 64 bitmachine • Julia isfasteron Linux and OSX than on Windows
Invitation: NLP++ Community • NLP++ • A programminglanguagefor Natural Language Processing • Based on C++ • Much easiertolearnandunderstandthan C++ • VisualText: An NLP++ IDE • NLP++ Community (http://dev.nlpcloud.net/) • Growingthenumber of NLP++ developers • Sharing tips & tricks • Improveouranalyzers • Ifenoughinterestexists: New MeetUp Group for NLP++ in Zurich!
Julia Binariesand IDEs • Download andinstallthebinaries • http://julialang.org/downloads/ • Currentstableversion (May 2014): v0.2.1 • Choose an IDE (bothareavailablefor Linux/OSX/WIN) • JuliaStudiobyforio(theone I am using) • http://forio.com/products/julia-studio/download/ • Based on Qt • LightTable • http://www.lighttable.com/ • Based on theClojure (JVM) • A veryinterestingapproach, it’sworthtogiveit a try
Julia Docs The Julia Manual: http://docs.julialang.org/en/release-0.2/manual/ The Julia Standard Library: http://docs.julialang.org/en/release-0.2/stdlib/ Available Packages: http://docs.julialang.org/en/release-0.2/packages/packagelist/
Julia Community Google Groups • julia-users • julia-dev • julia-stats • julia-opt Veryfriendlyandno questionistoobasic . We use GitHub to track our source code and for tracking and discussing issues and commits. There is also a list of packages for Julia, many of which are also hosted on and developed using GitHub.
Let’s Start with Julia • Vectors, Matrices, Arrays • Simple Calculations • Functions • Devectorization • Types http://learnxinyminutes.com/docs/julia/
The Creators of Julia Jeff Bezanson Stefan Karpinski Viral Shah Alan Edelman MIT studentsandresearchers
«Whywecreated Julia» Open Source Easy toinstall Speed of C Macros like Lisp Mathematicalnotation like MATLAB Compiled Dynamism like Ruby Linux / OSX / WIN Easy tolearn Keep hackers happy Interactive Statistics like R String processing like Perl Linear Algebra like in MATLAB Gluingprogramstogether like in a shell Liberal licence (MIT)