This document contains 13 examples of exercises related to control systems. The examples involve tasks such as deriving state space models, bringing feedback control systems into generalized standard form, designing controllers, computing norms, and parametrizing stabilizing controllers. The examples cover topics including disturbance decoupling, observer design, state feedback, and coprime factorizations.
Modeling the Dynamics of SGD by Stochastic Differential EquationMark Chang
1) Start with a small learning rate and large batch size to find a flat minimum with good generalization. 2) Gradually increase the learning rate and decrease the batch size to find sharper minima that may improve training accuracy. 3) Monitor both training and validation/test accuracy - similar accuracy suggests good generalization while different accuracy indicates overfitting.
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Databricks
There are lots of reasons why you might want to implement your own machine learning algorithms on Spark: you might want to experiment with a new idea, try and reproduce results from a recent research paper, or simply to use an existing technique that isn’t implemented in MLlib.
In this talk, we’ll walk through the process of developing a new machine learning algorithm for Spark. We’ll start with the basics, by considering how we’d design a scale-out parallel implementation of our unsupervised learning technique. The bulk of the talk will focus on the details you need to know to turn an algorithm design into an efficient parallel implementation on Spark.
We’ll start by reviewing a simple RDD-based implementation, show some improvements, point out some pitfalls to avoid, and iteratively extend our implementation to support contemporary Spark features like ML Pipelines and structured query processing. We’ll conclude by briefly examining some useful techniques to complement scale-out performance by scaling our code up, taking advantage of specialized hardware to accelerate single-worker performance.
You’ll leave this talk with everything you need to build a new machine learning technique that runs on Spark.
bayesImageS: Bayesian computation for medical Image Segmentation using a hidd...Matt Moores
This document summarizes an R package called bayesImageS that enables Bayesian computation for medical image segmentation using a hidden Potts model. It discusses the statistical model, which involves a hidden Markov random field with a Potts prior on the latent labels. Bayesian computation methods like Gibbs sampling and Metropolis-Hastings using pseudolikelihood approximation are implemented in C++ for efficiency. Experimental results demonstrate the package on a CT electron density phantom and patient radiotherapy data.
Biosight: Quantitative Methods for Policy Analysis : Dynamic ModelsIFPRI-EPTD
The document discusses dynamic programming and function approximation techniques. It introduces Bellman's principle of optimality and value function iteration. It uses a "cake eating" example to illustrate these concepts and show how to derive a closed-form solution. The document then discusses using Chebyshev polynomials and collocation to approximate value functions when analytical solutions are not possible. This allows dynamic programming problems to be solved numerically.
Crushing the Head of the Snake by Robert Brewer PyData SV 2014PyData
Big Data brings with it particular challenges in any language, mostly in performance. This talk will explain how to get immediate speedups in your Python code by exploiting both timeless programming techniques and fixes specific to Python. We will cover: I. Amongst Our Weaponry 1. How to Time and Profile Python 2. Extracting Loop invariants: constants, lookup tables, even methods! 3. Caching: memoization and heavier things II Gunfight at the O.K. Corral in Morse Code 1. Python functions vs C functions 2. Vector operations: NumPy 3. Reducing calls: loops, generators, recursion III. The Semaphore Version of Wuthering Heights 1. Using select instead of Queue 2. Serialization overhead 3. Parallelizing work
Home Work; Chapter 9; Inventory Policy DecisionsShaheen Sardar
Book reference: Ballou, Ronald H. (2004). “Business Logistics/ Supply Chain Management: Planning, Organizing, and Controlling the Supply Chain.” (5th Edition).
Original reference of this document: http://wweb.uta.edu/insyopma/prater/ballou09_im.pdf
Description of the Reactive Collections framework for event-driven, reactive and distributed programming, and the real-time game engine use case. See the game demos on YouTube:
http://www.youtube.com/channel/UCoyqnhi_BdpLrBVMvkNIMMw
This document contains 13 examples of exercises related to control systems. The examples involve tasks such as deriving state space models, bringing feedback control systems into generalized standard form, designing controllers, computing norms, and parametrizing stabilizing controllers. The examples cover topics including disturbance decoupling, observer design, state feedback, and coprime factorizations.
Modeling the Dynamics of SGD by Stochastic Differential EquationMark Chang
1) Start with a small learning rate and large batch size to find a flat minimum with good generalization. 2) Gradually increase the learning rate and decrease the batch size to find sharper minima that may improve training accuracy. 3) Monitor both training and validation/test accuracy - similar accuracy suggests good generalization while different accuracy indicates overfitting.
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Databricks
There are lots of reasons why you might want to implement your own machine learning algorithms on Spark: you might want to experiment with a new idea, try and reproduce results from a recent research paper, or simply to use an existing technique that isn’t implemented in MLlib.
In this talk, we’ll walk through the process of developing a new machine learning algorithm for Spark. We’ll start with the basics, by considering how we’d design a scale-out parallel implementation of our unsupervised learning technique. The bulk of the talk will focus on the details you need to know to turn an algorithm design into an efficient parallel implementation on Spark.
We’ll start by reviewing a simple RDD-based implementation, show some improvements, point out some pitfalls to avoid, and iteratively extend our implementation to support contemporary Spark features like ML Pipelines and structured query processing. We’ll conclude by briefly examining some useful techniques to complement scale-out performance by scaling our code up, taking advantage of specialized hardware to accelerate single-worker performance.
You’ll leave this talk with everything you need to build a new machine learning technique that runs on Spark.
bayesImageS: Bayesian computation for medical Image Segmentation using a hidd...Matt Moores
This document summarizes an R package called bayesImageS that enables Bayesian computation for medical image segmentation using a hidden Potts model. It discusses the statistical model, which involves a hidden Markov random field with a Potts prior on the latent labels. Bayesian computation methods like Gibbs sampling and Metropolis-Hastings using pseudolikelihood approximation are implemented in C++ for efficiency. Experimental results demonstrate the package on a CT electron density phantom and patient radiotherapy data.
Biosight: Quantitative Methods for Policy Analysis : Dynamic ModelsIFPRI-EPTD
The document discusses dynamic programming and function approximation techniques. It introduces Bellman's principle of optimality and value function iteration. It uses a "cake eating" example to illustrate these concepts and show how to derive a closed-form solution. The document then discusses using Chebyshev polynomials and collocation to approximate value functions when analytical solutions are not possible. This allows dynamic programming problems to be solved numerically.
Crushing the Head of the Snake by Robert Brewer PyData SV 2014PyData
Big Data brings with it particular challenges in any language, mostly in performance. This talk will explain how to get immediate speedups in your Python code by exploiting both timeless programming techniques and fixes specific to Python. We will cover: I. Amongst Our Weaponry 1. How to Time and Profile Python 2. Extracting Loop invariants: constants, lookup tables, even methods! 3. Caching: memoization and heavier things II Gunfight at the O.K. Corral in Morse Code 1. Python functions vs C functions 2. Vector operations: NumPy 3. Reducing calls: loops, generators, recursion III. The Semaphore Version of Wuthering Heights 1. Using select instead of Queue 2. Serialization overhead 3. Parallelizing work
Home Work; Chapter 9; Inventory Policy DecisionsShaheen Sardar
Book reference: Ballou, Ronald H. (2004). “Business Logistics/ Supply Chain Management: Planning, Organizing, and Controlling the Supply Chain.” (5th Edition).
Original reference of this document: http://wweb.uta.edu/insyopma/prater/ballou09_im.pdf
Description of the Reactive Collections framework for event-driven, reactive and distributed programming, and the real-time game engine use case. See the game demos on YouTube:
http://www.youtube.com/channel/UCoyqnhi_BdpLrBVMvkNIMMw
Bayesian Inference and Uncertainty Quantification for Inverse ProblemsMatt Moores
So-called “inverse” problems arise when the parameters of a physical system cannot be directly observed. The mapping between these latent parameters and the space of noisy observations is represented as a mathematical model, often involving a system of differential equations. We seek to infer the parameter values that best fit our observed data. However, it is also vital to obtain accurate quantification of the uncertainty involved with these parameters, particularly when the output of the model will be used for forecasting. Bayesian inference provides well-calibrated uncertainty estimates, represented by the posterior distribution over the parameters. In this talk, I will give a brief introduction to Markov chain Monte Carlo (MCMC) algorithms for sampling from the posterior distribution and describe how they can be combined with numerical solvers for the forward model. We apply these methods to two examples of ODE models: growth curves in ecology, and thermogravimetric analysis (TGA) in chemistry. This is joint work with Matthew Berry, Mark Nelson, Brian Monaghan and Raymond Longbottom.
This talk was given in underscore meetup in Tel Aviv in 24/06
-------
There is no doubt that Unit tests are an essential part of the development process today.
However, writing unit tests is a tedious and repetitive job that is often unrewarding since bugs slip away.
Property-based testing addresses these issues by providing a way to define laws and properties on your data types and generate tests to verify them.
Dor Sever is a software developer at bigpanda.io
1. The document discusses linear discrete control systems and their representation in state space form. It provides the general state space equations and describes how a discrete linear system with scalar input and output can be represented in controllable canonical form or observable canonical form.
2. It also discusses linear system stability analysis using characteristics polynomials as well as analyzing stability of nonlinear systems by linearizing around an operating point.
3. Feedback control system design is discussed where a controller is designed using input from both a reference signal and system output to generate the control input.
This document discusses time-domain analysis and design of control systems through block diagrams. It defines key terms like plant, controller, feedback, and transfer functions. It describes how to represent systems using block diagrams and rules for simplifying block diagrams, including combining blocks in series and parallel and eliminating feedback loops. Examples are provided to demonstrate reducing complex block diagrams to standard forms and handling multiple-input systems using superposition.
R package 'bayesImageS': a case study in Bayesian computation using Rcpp and ...Matt Moores
There are many approaches to Bayesian computation with intractable likelihoods, including the exchange algorithm, approximate Bayesian computation (ABC), thermodynamic integration, and composite likelihood. These approaches vary in accuracy as well as scalability for datasets of significant size. The Potts model is an example where such methods are required, due to its intractable normalising constant. This model is a type of Markov random field, which is commonly used for image segmentation. The dimension of its parameter space increases linearly with the number of pixels in the image, making this a challenging application for scalable Bayesian computation. My talk will introduce various algorithms in the context of the Potts model and describe their implementation in C++, using OpenMP for parallelism. I will also discuss the process of releasing this software as an open source R package on the CRAN repository.
The document discusses time series analysis techniques in R, including decomposition, forecasting, clustering, and classification. It provides an overview of methods such as ARIMA modeling, dynamic time warping, discrete wavelet transforms, and decision trees. Examples are shown applying these techniques to air passenger data and synthetic control chart time series data, including decomposing, forecasting, hierarchical clustering with Euclidean and DTW distances, and classifying with decision trees using DWT features. Accuracy of over 80% is achieved on the classification tasks.
The document provides an example of using R to compute maximum likelihood estimates (MLE) for common probability distributions. It demonstrates computing the MLE for the normal distribution using the nlm and optim functions in R. The MLE is estimated to be 1.714284 for the mean and 11.346933 for the variance. Some checks are shown to validate the MLE estimates. The document also provides examples of computing likelihood ratio tests and confidence intervals for the normal distribution parameters, and demonstrates a t-test and likelihood ratio test for the mean.
This document summarizes methods for performing causality and determinacy tests on time series data using R scripts. It describes:
1. Implementing the Test(S), Test(ABN), Test(CS), Test(D) methods to test for stationarity, abnormalities, causality, and determinacy in money velocity time series data.
2. Using R functions like scan(), log(), diff(), scale2() to transform data and $testCS, $plotTestCS, $testD, $plotTestD to run the tests and visualize results.
3. Applying the tests to money velocity data in Japan from 1955-2001 to analyze causality and determinacy properties over time.
This document contains a 10-question problem set on digital signal processing. The problems cover topics such as determining the impulse response and transfer function of discrete-time systems described by difference equations, analyzing stability of systems, computing outputs given certain inputs, and realizing systems in block diagrams. Students are asked to find input-output relations, plot frequency responses, solve for poles and zeros, and analyze other properties of linear time-invariant discrete-time systems. The problems progress from simpler analyses to more complex issues like stability determination.
This document describes the design of a servo system using state feedback and integral control. It defines the plant state and output equations, and shows the block diagram of the servo system. The state equation of the augmented system is derived, combining the plant states and integrator states. The gains K1 and K2 are selected using pole placement so that the closed-loop poles of the combined system are located at the desired locations. An example is provided to illustrate the design process.
This chapter discusses stability in discrete-time control systems. Stability means that without input, the system output will settle to zero over time. Stability can be determined by examining the location of the system's poles - a system is stable if all poles lie inside the unit circle in the complex plane. The chapter presents definitions of stability and criteria for assessing it, including frequency domain criteria and generalized notions of stability. It also covers stationary responses and how poles relate to the rate of settling to zero output.
The document discusses solving linear equations using numerical methods in MATLAB. It provides code implementations for Gauss-Seidel method, Jacobi method, and Cholesky method. It also includes routines for calculating the inverse of a 3x3 matrix, matrix norm, and forward substitution. Examples are given applying each method to different 3x3 matrices. Spectral radius is also calculated for some examples to analyze convergence properties.
The document discusses time series analysis and forecasting using R. It covers topics such as time series decomposition to separate trends, seasonality and other components. Time series forecasting models like ARMA and ARIMA are discussed. An example uses an ARIMA model to forecast airline passenger data and plots the forecasts along with 95% confidence error bounds. R packages and functions for time series analysis are also covered.
An Introduction into Anomaly Detection Using CUSUMDominik Dahlem
A gentle introduction into anomaly detection using the cumulative sum (CUSUM) algorithm. Extensive visuals are used to exemplify the inner workings of the algorithm. CUSUM relies on stationarity assumptions of the underlying process.
The document demonstrates various operations that can be performed on vectors and data frames in R. It shows how to create, subset, reorder, and modify vectors and data frames. Key operations include subsetting vectors and data frames using indices or logical vectors, applying functions to entire vectors or selected elements, and reordering a data frame based on the values in one of its columns.
This document introduces R functions for analyzing time-series data. It describes functions for testing the stationarity of time series, identifying break points, and computing determinacy and causality values. The functions prototype tests originally developed as Basic and Java programs. The R functions offer easy usability, powerful data processing and visualization capabilities. Examples demonstrate applying stationary, abnormality, determinacy, and causality tests to economic time series data from Japan. Further refinement of some tests and visualization skills is still needed.
The document discusses several object-oriented programming concepts in Java including passing objects as parameters, methods returning objects, method overloading, constructor overloading, inheritance, method overriding, and subclass constructors. It provides examples to illustrate each concept. The key points are:
1. Objects can be passed as parameters to methods and a method can return an object.
2. Methods and constructors can be overloaded based on parameters to allow different implementations.
3. Inheritance allows classes to extend existing classes to reuse properties and methods.
4. Method overriding allows redefining methods in a subclass.
5. Subclass constructors use the super keyword to invoke the parent constructor.
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...Leo Asselborn
This presentation proposes an algorithmic approach to
synthesize stabilizing control laws for discrete-time piecewise
affine probabilistic (PWAP) systems based on computations of
probabilistic reachable sets. The considered class of systems
contains probabilistic components (with Gaussian distribution)
modeling additive disturbances and state initialization. The
probabilistic reachable state sets contain all states that are
reachable with a given confidence level under the effect of
time-variant control laws. The control synthesis uses principles
of the ellipsoidal calculus, and it considers that the system
parametrization depends on the partition of the state space. The
proposed algorithm uses LMI-constrained semi-definite programming
(SDP) problems to compute stabilizing controllers,
while polytopic input constraints and transitions between regions
of the state space are considered. The formulation of
the SDP is adopted from a previous work in [1] for switched
systems, in which the switching of the continuous dynamics
is triggered by a discrete input variable. Here, as opposed
to [1], the switching occurs autonomously and an algorithmic
procedure is suggested to synthesis a stabilizing controller. An
example for illustration is included.
Program verification involves formally proving that a program satisfies certain properties, such as having no defects, by establishing that the program meets its specification. This is done by defining preconditions and postconditions and using weakest preconditions to reason about how the program transforms states. Testing involves running a program with sample inputs and checking that the outputs are as expected to find defects empirically.
This document describes ScalaMeter, a performance regression testing framework. It discusses several problems that can occur when benchmarking code performance, including warmup effects from JIT compilation, interference from other processes, garbage collection triggering, and variability from other runtime events. It provides examples demonstrating these issues and discusses solutions like running benchmarks in a separate JVM, ignoring measurements impacted by garbage collection, and performing many repetitions to obtain a stable mean.
I am Paul G. I am a Mechanical Engineering Assignment Expert at matlabassignmentexperts.com. I hold a Ph.D. Matlab, University of Adelaide, Australia. I have been helping students with their homework for the past 10 years. I solve assignments related to Mechanical Engineering.
Visit matlabassignmentexperts.com or email info@matlabassignmentexperts.com.
You can also call on +1 678 648 4277 for any assistance with Mechanical Engineering Assignments.
Bayesian Inference and Uncertainty Quantification for Inverse ProblemsMatt Moores
So-called “inverse” problems arise when the parameters of a physical system cannot be directly observed. The mapping between these latent parameters and the space of noisy observations is represented as a mathematical model, often involving a system of differential equations. We seek to infer the parameter values that best fit our observed data. However, it is also vital to obtain accurate quantification of the uncertainty involved with these parameters, particularly when the output of the model will be used for forecasting. Bayesian inference provides well-calibrated uncertainty estimates, represented by the posterior distribution over the parameters. In this talk, I will give a brief introduction to Markov chain Monte Carlo (MCMC) algorithms for sampling from the posterior distribution and describe how they can be combined with numerical solvers for the forward model. We apply these methods to two examples of ODE models: growth curves in ecology, and thermogravimetric analysis (TGA) in chemistry. This is joint work with Matthew Berry, Mark Nelson, Brian Monaghan and Raymond Longbottom.
This talk was given in underscore meetup in Tel Aviv in 24/06
-------
There is no doubt that Unit tests are an essential part of the development process today.
However, writing unit tests is a tedious and repetitive job that is often unrewarding since bugs slip away.
Property-based testing addresses these issues by providing a way to define laws and properties on your data types and generate tests to verify them.
Dor Sever is a software developer at bigpanda.io
1. The document discusses linear discrete control systems and their representation in state space form. It provides the general state space equations and describes how a discrete linear system with scalar input and output can be represented in controllable canonical form or observable canonical form.
2. It also discusses linear system stability analysis using characteristics polynomials as well as analyzing stability of nonlinear systems by linearizing around an operating point.
3. Feedback control system design is discussed where a controller is designed using input from both a reference signal and system output to generate the control input.
This document discusses time-domain analysis and design of control systems through block diagrams. It defines key terms like plant, controller, feedback, and transfer functions. It describes how to represent systems using block diagrams and rules for simplifying block diagrams, including combining blocks in series and parallel and eliminating feedback loops. Examples are provided to demonstrate reducing complex block diagrams to standard forms and handling multiple-input systems using superposition.
R package 'bayesImageS': a case study in Bayesian computation using Rcpp and ...Matt Moores
There are many approaches to Bayesian computation with intractable likelihoods, including the exchange algorithm, approximate Bayesian computation (ABC), thermodynamic integration, and composite likelihood. These approaches vary in accuracy as well as scalability for datasets of significant size. The Potts model is an example where such methods are required, due to its intractable normalising constant. This model is a type of Markov random field, which is commonly used for image segmentation. The dimension of its parameter space increases linearly with the number of pixels in the image, making this a challenging application for scalable Bayesian computation. My talk will introduce various algorithms in the context of the Potts model and describe their implementation in C++, using OpenMP for parallelism. I will also discuss the process of releasing this software as an open source R package on the CRAN repository.
The document discusses time series analysis techniques in R, including decomposition, forecasting, clustering, and classification. It provides an overview of methods such as ARIMA modeling, dynamic time warping, discrete wavelet transforms, and decision trees. Examples are shown applying these techniques to air passenger data and synthetic control chart time series data, including decomposing, forecasting, hierarchical clustering with Euclidean and DTW distances, and classifying with decision trees using DWT features. Accuracy of over 80% is achieved on the classification tasks.
The document provides an example of using R to compute maximum likelihood estimates (MLE) for common probability distributions. It demonstrates computing the MLE for the normal distribution using the nlm and optim functions in R. The MLE is estimated to be 1.714284 for the mean and 11.346933 for the variance. Some checks are shown to validate the MLE estimates. The document also provides examples of computing likelihood ratio tests and confidence intervals for the normal distribution parameters, and demonstrates a t-test and likelihood ratio test for the mean.
This document summarizes methods for performing causality and determinacy tests on time series data using R scripts. It describes:
1. Implementing the Test(S), Test(ABN), Test(CS), Test(D) methods to test for stationarity, abnormalities, causality, and determinacy in money velocity time series data.
2. Using R functions like scan(), log(), diff(), scale2() to transform data and $testCS, $plotTestCS, $testD, $plotTestD to run the tests and visualize results.
3. Applying the tests to money velocity data in Japan from 1955-2001 to analyze causality and determinacy properties over time.
This document contains a 10-question problem set on digital signal processing. The problems cover topics such as determining the impulse response and transfer function of discrete-time systems described by difference equations, analyzing stability of systems, computing outputs given certain inputs, and realizing systems in block diagrams. Students are asked to find input-output relations, plot frequency responses, solve for poles and zeros, and analyze other properties of linear time-invariant discrete-time systems. The problems progress from simpler analyses to more complex issues like stability determination.
This document describes the design of a servo system using state feedback and integral control. It defines the plant state and output equations, and shows the block diagram of the servo system. The state equation of the augmented system is derived, combining the plant states and integrator states. The gains K1 and K2 are selected using pole placement so that the closed-loop poles of the combined system are located at the desired locations. An example is provided to illustrate the design process.
This chapter discusses stability in discrete-time control systems. Stability means that without input, the system output will settle to zero over time. Stability can be determined by examining the location of the system's poles - a system is stable if all poles lie inside the unit circle in the complex plane. The chapter presents definitions of stability and criteria for assessing it, including frequency domain criteria and generalized notions of stability. It also covers stationary responses and how poles relate to the rate of settling to zero output.
The document discusses solving linear equations using numerical methods in MATLAB. It provides code implementations for Gauss-Seidel method, Jacobi method, and Cholesky method. It also includes routines for calculating the inverse of a 3x3 matrix, matrix norm, and forward substitution. Examples are given applying each method to different 3x3 matrices. Spectral radius is also calculated for some examples to analyze convergence properties.
The document discusses time series analysis and forecasting using R. It covers topics such as time series decomposition to separate trends, seasonality and other components. Time series forecasting models like ARMA and ARIMA are discussed. An example uses an ARIMA model to forecast airline passenger data and plots the forecasts along with 95% confidence error bounds. R packages and functions for time series analysis are also covered.
An Introduction into Anomaly Detection Using CUSUMDominik Dahlem
A gentle introduction into anomaly detection using the cumulative sum (CUSUM) algorithm. Extensive visuals are used to exemplify the inner workings of the algorithm. CUSUM relies on stationarity assumptions of the underlying process.
The document demonstrates various operations that can be performed on vectors and data frames in R. It shows how to create, subset, reorder, and modify vectors and data frames. Key operations include subsetting vectors and data frames using indices or logical vectors, applying functions to entire vectors or selected elements, and reordering a data frame based on the values in one of its columns.
This document introduces R functions for analyzing time-series data. It describes functions for testing the stationarity of time series, identifying break points, and computing determinacy and causality values. The functions prototype tests originally developed as Basic and Java programs. The R functions offer easy usability, powerful data processing and visualization capabilities. Examples demonstrate applying stationary, abnormality, determinacy, and causality tests to economic time series data from Japan. Further refinement of some tests and visualization skills is still needed.
The document discusses several object-oriented programming concepts in Java including passing objects as parameters, methods returning objects, method overloading, constructor overloading, inheritance, method overriding, and subclass constructors. It provides examples to illustrate each concept. The key points are:
1. Objects can be passed as parameters to methods and a method can return an object.
2. Methods and constructors can be overloaded based on parameters to allow different implementations.
3. Inheritance allows classes to extend existing classes to reuse properties and methods.
4. Method overriding allows redefining methods in a subclass.
5. Subclass constructors use the super keyword to invoke the parent constructor.
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...Leo Asselborn
This presentation proposes an algorithmic approach to
synthesize stabilizing control laws for discrete-time piecewise
affine probabilistic (PWAP) systems based on computations of
probabilistic reachable sets. The considered class of systems
contains probabilistic components (with Gaussian distribution)
modeling additive disturbances and state initialization. The
probabilistic reachable state sets contain all states that are
reachable with a given confidence level under the effect of
time-variant control laws. The control synthesis uses principles
of the ellipsoidal calculus, and it considers that the system
parametrization depends on the partition of the state space. The
proposed algorithm uses LMI-constrained semi-definite programming
(SDP) problems to compute stabilizing controllers,
while polytopic input constraints and transitions between regions
of the state space are considered. The formulation of
the SDP is adopted from a previous work in [1] for switched
systems, in which the switching of the continuous dynamics
is triggered by a discrete input variable. Here, as opposed
to [1], the switching occurs autonomously and an algorithmic
procedure is suggested to synthesis a stabilizing controller. An
example for illustration is included.
Program verification involves formally proving that a program satisfies certain properties, such as having no defects, by establishing that the program meets its specification. This is done by defining preconditions and postconditions and using weakest preconditions to reason about how the program transforms states. Testing involves running a program with sample inputs and checking that the outputs are as expected to find defects empirically.
This document describes ScalaMeter, a performance regression testing framework. It discusses several problems that can occur when benchmarking code performance, including warmup effects from JIT compilation, interference from other processes, garbage collection triggering, and variability from other runtime events. It provides examples demonstrating these issues and discusses solutions like running benchmarks in a separate JVM, ignoring measurements impacted by garbage collection, and performing many repetitions to obtain a stable mean.
I am Paul G. I am a Mechanical Engineering Assignment Expert at matlabassignmentexperts.com. I hold a Ph.D. Matlab, University of Adelaide, Australia. I have been helping students with their homework for the past 10 years. I solve assignments related to Mechanical Engineering.
Visit matlabassignmentexperts.com or email info@matlabassignmentexperts.com.
You can also call on +1 678 648 4277 for any assistance with Mechanical Engineering Assignments.
TALLER PARCIAL II CÁLCULO 3246 (CASTRO,SALAZAR,SHIGUANGO)ChrysleerSalazar
The document is a report on the application of derivatives in mechanical engineering. It contains an introduction on the importance of calculus and derivatives in engineering. It then outlines the objectives and theoretical foundations, including concepts like increasing/decreasing functions, optimization, and using the first and second derivatives to determine maxima/minima and points of inflection. The development section solves two problems as examples: 1) Using derivatives to maximize the area of a steam engine chamber and find the maximum force of the piston, and 2) Using derivatives to minimize the perimeter of a laser cutting machine and find its optimal dimensions.
The document describes 11 MATLAB programs for simulating wireless communication networks. It provides instructions for running the main simulation programs dcamain.m and main.m, including how to set parameters, run the simulations, and view the results. Key outputs include plots of blocking probability over time and against system parameters like user numbers or antenna beamwidths.
The Ring programming language version 1.3 book - Part 16 of 88Mahmoud Samir Fayed
The document provides documentation on file handling functions in Ring programming language. It describes functions for reading and writing files, getting directory listings, renaming and deleting files, opening, closing and manipulating file streams. Examples are given showing how to use functions like Read(), Write(), Dir(), Rename(), Remove(), Fopen(), Fclose(), Freopen() etc. to perform common file operations in Ring.
Polyglot Persistence in the Real World: Cassandra + S3 + MapReducethumbtacktech
This talk focuses on building a system from scratch, showing how to perform analytical queries in near real-time and still get the benefits of high performance database engine of Cassandra. The key subjects of my speech are:
● The splendors and miseries of NoSQL
● Apache Cassandra use-cases
● Difficulties of using MapReduce directly in Cassandra
● Amazon cloud solutions: Elastic MapReduce and S3
● “real-enough” time analysis
In particular the talk dives into ways of handling different kinds of semi-ad-hoc queries when using Cassandra, the pitfalls in designing a schema around a specific analytics use case. Some attention will be paid towards dealing with time series data in particular, which can present a real problem when using Column-Family or Key-Value store databases.
The Cassandra database is an excellent choice when you need scalability and high availability without compromising performance. Cassandra’s linear scalability, proven fault tolerance and tunable consistency, combined with its being optimized for write traffic, make it an attractive choice for performing structured logging of application and transactional events. But using a columnar store like Cassandra for analytical needs poses its own problems, problems we solved by careful construction of Column Families combined with diplomatic use of Hadoop.
This tutorial focuses on building a similar system from scratch, showing how to perform analytical queries in near real time and still getting the benefits of the high-performance database engine of Cassandra. The key subjects are:
• The splendors and miseries of NoSQL
• Apache Cassandra use cases
• Difficulties of using Map/Reduce directly in Cassandra
• Amazon cloud solutions: Elastic MapReduce and S3
• “Real-enough” time analysis
Slides for the Reactive 3D Game Engine presented at ScalaDays 2014.
Shows the demo of the 3D engine, followed by the description of the reactive 3D game engine - how reactive dependencies between input, time and game logic are expressed, how to deal with GC issues, how to model game state using Reactive Collections.
This document provides examples that demonstrate solving systems of equations, continuous-time state-space models, and using strings and scripts in Scilab. Example 2-1 shows how to solve a system of 3 equations with 3 unknowns by writing the equations in matrix form and using the backslash operator. Example 2-2 demonstrates using mesh currents to solve a circuit problem since Kirchhoff's law leads to a non-square matrix. Example 2-3 defines a state-space model and simulates the output and state responses. Example 2-4 is a script that converts a time in seconds to hours, minutes and seconds using strings, input, floor, and modulo functions.
The document provides contact information for Python Homework Help, including their website, email address, and phone number. It then presents sample code defining two Python classes - A and B (which inherits from A) - and evaluates various expressions involving objects of these classes. Next, it defines Student and StudentBody classes to represent university students and evaluates methods on a sample StudentBody object. Finally, it presents additional examples involving state machine definitions and difference equations.
https://telecombcn-dl.github.io/2018-dlai/
Deep learning technologies are at the core of the current revolution in artificial intelligence for multimedia data analysis. The convergence of large-scale annotated datasets and affordable GPU hardware has allowed the training of neural networks for data analysis tasks which were previously addressed with hand-crafted features. Architectures such as convolutional neural networks, recurrent neural networks or Q-nets for reinforcement learning have shaped a brand new scenario in signal processing. This course will cover the basic principles of deep learning from both an algorithmic and computational perspectives.
Design and Implementation of Parallel and Randomized Approximation AlgorithmsAjay Bidyarthy
This document summarizes the design and implementation of parallel and randomized approximation algorithms for solving matrix games, linear programs, and semi-definite programs. It presents solvers for these problems that provide approximate solutions in sublinear or near-linear time. It analyzes the performance and precision-time tradeoffs of the solvers compared to other algorithms. It also provides examples of applying the SDP solver to approximate the Lovasz theta function.
MATLAB DOCUMENTATION ON SOME OF THE MODULES
A.Generate videos in which a skeleton of a person doing the following Gestures.
1.Tilting his head to right and left
2.Tilting his hand to right and left
3.Walking
in matlab.
B. Write a MATLAB program that converts a decimal number to Roman number and vice versa.
C.Using EZ plot & anonymous functions plot the following:
· Y=Sqrt(X)
· Y= X^2
· Y=e^(-XY)
D.Take your picture and
· Show R, G, B channels along with RGB Image in same figure using sub figure.
· Convert into HSV( Hue, saturation and value) and show the H,S,V channels along with HSV image
E.Record your name pronounced by yourself. Try to display the signal(name) in a plot vs Time, using matlab.
F.Write a script to open a new figure and plot five circles, all centered at the origin and with increasing radii. Set the line width for each circle to something thick (at least 2 points), and use the colors from a 5-color jet colormap (jet).
G. NEWTON RAPHSON AND SECANT METHOD
H.Write any one of the program to do following things using file concept.
1.Create or Open a file
2. Read data from the file and write data to another file
3. Append some text to already existed file
4. Close the file
I.Write a function to perform following set operations
1.Union of A and B
2. Intersection of A and B
3. Complement of A and B
(Assume A= {1, 2, 3, 4, 5, 6}, B= {2, 4, 6})
Investigación de operaciones 026 programación lineal Solución Simplex con R S...Jorge Pablo Rivas
This document describes using the simplex method in R to solve linear programming problems. It provides code to:
1) Install necessary packages for simplex method
2) Load libraries and define a sample linear program with objective function and constraints
3) Call the simplex function to solve the sample problem, returning the optimal solution
The document explains the simplex method code and provides an example problem from a textbook to demonstrate setting up and solving a linear program in R.
This document provides an introduction to MATLAB. It covers MATLAB basics like arithmetic, variables, vectors, matrices and built-in functions. It also discusses plotting graphs, programming in MATLAB by creating functions and scripts, and solving systems of linear equations. The document is compiled by Endalkachew Teshome from the Department of Mathematics at AMU for teaching MATLAB.
A BA-based algorithm for parameter optimization of support vector machineAboul Ella Hassanien
Presentation at the workshop on Intelligent systems and application, held at faculty of computer and information, Cairo University on Saturday 3 Dec. 2016
The document provides an introduction to MATLAB, describing the main environment components like the command window and workspace. It explains basic MATLAB functions and variables, arrays, control flow statements, M-files, and common plotting and data analysis tools. Examples are given of different array operations, control structures, and building simple MATLAB functions and scripts.
This document provides an introduction to MATLAB and Simulink. It discusses built-in functions, vectors and matrices, modeling examples, M-files for scripts and functions. It also explores the MATLAB desktop, command window, and workspace. Examples are provided on arithmetic operations on matrices, plotting graphs, writing functions, and modeling an RLC circuit in Simulink.
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
3. Goal
List(1 to 100000: _*).map(x => x * x)
class List[+T]
extends Seq[T] {
// implementation 1
}
26 ms
4. Goal
List(1 to 100000: _*).map(x => x * x)
class List[+T]
extends Seq[T] {
// implementation 1
}
26 ms
5. Goal
List(1 to 100000: _*).map(x => x * x)
class List[+T]
extends Seq[T] {
// implementation 2
}
49 ms
6. First example
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
7. First example
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
8. First example
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
9. First example
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
10. First example
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
measure()
11. First example
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
measure()
26 ms
12. The warmup problem
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
measure()
measure()
26 ms, 11 ms
13. The warmup problem
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
measure()
measure()
26 ms, 11 ms
Why?
Mainly:
- JIT compilation
- dynamic optimization
14. The warmup problem
def measure() {
val buffer = mutable.ArrayBuffer(0 until 2000000: _*)
val start = System.currentTimeMillis()
var sum = 0
buffer.foreach(sum += _)
val end = System.currentTimeMillis()
println(end - start)
}
45 ms, 10 ms
26 ms, 11 ms
15. The warmup problem
def measure2() {
val buffer = mutable.ArrayBuffer(0 until 4000000: _*)
val start = System.currentTimeMillis()
buffer.map(_ + 1)
val end = System.currentTimeMillis()
println(end - start)
}
16. The warmup problem
def measure2() {
val buffer = mutable.ArrayBuffer(0 until 4000000: _*)
val start = System.currentTimeMillis()
buffer.map(_ + 1)
val end = System.currentTimeMillis()
println(end - start)
}
241, 238, 235, 236, 234
17. The warmup problem
def measure2() {
val buffer = mutable.ArrayBuffer(0 until 4000000: _*)
val start = System.currentTimeMillis()
buffer.map(_ + 1)
val end = System.currentTimeMillis()
println(end - start)
}
241, 238, 235, 236, 234, 429
18. The warmup problem
def measure2() {
val buffer = mutable.ArrayBuffer(0 until 4000000: _*)
val start = System.currentTimeMillis()
buffer.map(_ + 1)
val end = System.currentTimeMillis()
println(end - start)
}
241, 238, 235, 236, 234, 429, 209
19. The warmup problem
def measure2() {
val buffer = mutable.ArrayBuffer(0 until 4000000: _*)
val start = System.currentTimeMillis()
buffer.map(_ + 1)
val end = System.currentTimeMillis()
println(end - start)
}
241, 238, 235, 236, 234, 429, 209, 194, 195, 195
20. The warmup problem
Bottomline: benchmark has to be repeated until the running time becomes “stable”.
The number of repetitions is not known in advance.
241, 238, 235, 236, 234, 429, 209, 194, 195, 195
21. Warming up the JVM
241, 238, 235, 236, 234, 429, 209, 194, 195, 195,
194, 194, 193, 194, 196, 195, 195
Can this be automated?
Idea: measure variance of the running times.
When it becomes sufficiently small, the test has stabilized.
22. The interference problem
val buffer = ArrayBuffer(0 until 900000: _*)
buffer.map(_ + 1)
val buffer = ListBuffer(0 until 900000: _*)
buffer.map(_ + 1)
23. The interference problem
Lets measure the first map 3 times with 7 repetitions:
val buffer = ArrayBuffer(0 until 900000: _*)
buffer.map(_ + 1)
val buffer = ListBuffer(0 until 900000: _*)
buffer.map(_ + 1)
61, 54, 54, 54, 55, 55, 56
186, 54, 54, 54, 55, 54, 53
54, 54, 53, 53, 53, 54, 51
24. The interference problem
val buffer = ArrayBuffer(0 until 900000: _*)
buffer.map(_ + 1)
val buffer = ListBuffer(0 until 900000: _*)
buffer.map(_ + 1)
Now, lets measure the list buffer map in between:
61, 54, 54, 54, 55, 55, 56
186, 54, 54, 54, 55, 54, 53
54, 54, 53, 53, 53, 54, 51
59, 54, 54, 54, 54, 54, 54
44, 36, 36, 36, 35, 36, 36
45, 45, 45, 45, 44, 46, 45
18, 17, 18, 18, 17, 292, 16
45, 45, 44, 44, 45, 45, 44
25. The interference problem
val buffer = ArrayBuffer(0 until 900000: _*)
buffer.map(_ + 1)
val buffer = ListBuffer(0 until 900000: _*)
buffer.map(_ + 1)
Now, lets measure the list buffer map in between:
61, 54, 54, 54, 55, 55, 56
186, 54, 54, 54, 55, 54, 53
54, 54, 53, 53, 53, 54, 51
59, 54, 54, 54, 54, 54, 54
44, 36, 36, 36, 35, 36, 36
45, 45, 45, 45, 44, 46, 45
18, 17, 18, 18, 17, 292, 16
45, 45, 44, 44, 45, 45, 44
27. Using separate JVM
Bottomline: always run the tests in a new JVM.
This may not reflect a real-world scenario, but it gives a good idea of how different several alternatives are.
28. Using separate JVM
Bottomline: always run the tests in a new JVM.
It results in a reproducible, more stable measurement.
30. The List.map example
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
37, 38, 37, 1175, 38, 37, 37, 37, 37, …, 38, 37, 37, 37, 37, 465, 35, 35, …
31. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
37, 38, 37, 1175, 38, 37, 37, 37, 37, …, 38, 37, 37, 37, 37, 465, 35, 35, …
This benchmark triggers GC cycles!
32. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
37, 38, 37, 1175, 38, 37, 37, 37, 37, …, 38, 37, 37, 37, 37, 465, 35, 35, … -> mean: 47 ms
This benchmark triggers GC cycles!
33. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
37, 38, 37, 1175, 38, 37, 37, 37, 37, …, 38, 37, 37, 37, 37, 465, 35, 35, … -> mean: 47 ms
This benchmark triggers GC cycles!
37, 37, 37, 647, 37, 36, 38, 37, 36, …, 36, 37, 36, 37, 36, 37, 534, 36, 33, … -> mean: 39 ms
34. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
37, 38, 37, 1175, 38, 37, 37, 37, 37, …, 38, 37, 37, 37, 37, 465, 35, 35, … -> mean: 47 ms
This benchmark triggers GC cycles!
37, 37, 37, 647, 37, 36, 38, 37, 36, …, 36, 37, 36, 37, 36, 37, 534, 36, 33, … -> mean: 39 ms
35. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
Solutions:
-repeat A LOT of times –an accurate mean, but takes A LONG time
36. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
Solutions:
-repeat A LOT of times –an accurate mean, but takes A LONG time
-ignore the measurements with GC – gives a reproducible value, and less measurements
37. The garbage collection problem
val list = (0 until 2500000).toList
list.map(_ % 2 == 0)
Solutions:
-repeat A LOT of times –an accurate mean, but takes A LONG time
-ignore the measurements with GC – gives a reproducible value, and less measurements
-how to do this?
38. The garbage collection problem
val list = (0 until 2500000).toList list.map(_ % 2 == 0)
-manually - verbose:gc
39. Automatic GC detection
val list = (0 until 2500000).toList list.map(_ % 2 == 0)
-manually - verbose:gc
-automatically using callbacks in JDK7
37, 37, 37, 647, 37, 36, 38, 37, 36, …, 36, 37, 36, 37, 36, 37, 534, 36, 33, …
40. Automatic GC detection
val list = (0 until 2500000).toList list.map(_ % 2 == 0)
-manually - verbose:gc
-automatically using callbacks in JDK7
37, 37, 37, 647, 37, 36, 38, 37, 36, …, 36, 37, 36, 37, 36, 37, 534, 36, 33, …
raises a GC event
41. The runtime problem
-there are other runtime events beside GC – e.g. JIT compilation, dynamic optimization, etc.
-these take time, but cannot be determined accurately
42. The runtime problem
-there are other runtime events beside GC – e.g. JIT compilation, dynamic optimization, etc.
-these take time, but cannot be determined accurately
-heap state also influences memory allocation patterns and performance
43. The runtime problem
-there are other runtime events beside GC – e.g. JIT compilation, dynamic optimization, etc.
-these take time, but cannot be determined accurately
-heap state also influences memory allocation patterns and performance
val list = (0 until 4000000).toList
list.groupBy(_ % 10)
(allocation intensive)
44. The runtime problem
-there are other runtime events beside GC – e.g. JIT compilation, dynamic optimization, etc.
-these take time, but cannot be determined accurately
-heap state also influences memory allocation patterns and performance
val list = (0 until 4000000).toList list.groupBy(_ % 10)
120, 121, 122, 118, 123, 794, 109, 111, 115, 113, 110
45. The runtime problem
-there are other runtime events beside GC – e.g. JIT compilation, dynamic optimization, etc.
-these take time, but cannot be determined accurately
-heap state also influences memory allocation patterns and performance
val list = (0 until 4000000).toList list.groupBy(_ % 10)
120, 121, 122, 118, 123, 794, 109, 111, 115, 113, 110
affects the mean – 116 ms vs 178 ms
51. ScalaMeter
Does all this analysis automatically, highly configurable. Plus, it detects performance regressions. And generates reports.
52. ScalaMeter example
object ListTest extends PerformanceTest.Microbenchmark {
A range of predefined benchmark types
53. ScalaMeter example
object ListTest extends PerformanceTest.Microbenchmark { val sizes = Gen.range("size”)(500000, 1000000, 100000)
Generators provide input data for tests
54. ScalaMeter example
object ListTest extends PerformanceTest.Microbenchmark { val sizes = Gen.range("size”)(500000, 1000000, 100000) val lists = for (sz <- sizes) yield (0 until sz).toList
Generators can be composed a la ScalaCheck
55. ScalaMeter example
object ListTest extends PerformanceTest.Microbenchmark { val sizes = Gen.range("size”)(500000, 1000000, 100000) val lists = for (sz <- sizes) yield (0 until sz).toList using(lists) in { xs => xs.groupBy(_ % 10) } }
Concise syntax to specify and group tests
56. ScalaMeter example
object ListTest extends PerformanceTest.Microbenchmark { val sizes = Gen.range("size”)(500000, 1000000, 100000) val lists = for (sz <- sizes) yield (0 until sz).toList measure method “groupBy” in { using(lists) in { xs => xs.groupBy(_ % 10) } using(ranges) in { xs => xs.groupBy(_ % 10) } } }
60. Automatic regression testing
using(lists) in { xs => var sum = 0 xs.foreach(x => sum += math.sqrt(x)) }
[info] Test group: foreach [info] - foreach.Test-0 measurements: [info] - at size -> 2000000, 2 alternatives: failed [info] (ci = <14.57, 15.38>, significance = 1.0E-10) [error] Failed confidence interval test: <-7.85, -6.60> [error] Previous (mean = 7.75, stdev = 0.44, ci = <7.28, 8.22>) [error] Latest (mean = 14.97, stdev = 0.38, ci = <14.57, 15.38>)
61. Automatic regression testing
-configurable: ANOVA (analysis of variance) or confidence interval testing
-can apply noise to make unstable tests more solid
-various policies on keeping the result history