{"id":2850,"date":"2019-09-20T16:35:44","date_gmt":"2019-09-20T16:35:44","guid":{"rendered":"https:\/\/blogs.mathworks.com\/deep-learning\/?p=2850"},"modified":"2021-04-06T15:49:35","modified_gmt":"2021-04-06T19:49:35","slug":"whats-new-in-19b-matlab","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/deep-learning\/2019\/09\/20\/whats-new-in-19b-matlab\/","title":{"rendered":"What&#8217;s New in 19b: MATLAB"},"content":{"rendered":"<span style=\"font-family: courier;\">This post is from Heather Gorr - MATLAB product marketing - here to talk about the new release of R2019b and new MATLAB functionality related to deep learning. You can get a high level overview of everything new in this release with an overview video on the <strong><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.mathworks.com\/products\/new_products\/latest_features.html\">release page<\/a><\/span><\/strong>, or dive into the specifics in the <strong><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.mathworks.com\/help\/relnotes\/index.html\">release notes<\/a><\/span><\/strong>.<\/span>\r\n<h6><\/h6>\r\n<h6><\/h6>\r\nIt's not just <strong>Deep Learning Toolbox<\/strong> that has deep learning capabilities: When you look for what's new for deep learning, you should also think of base MATLAB. This release has many assorted goodies, but there are some new features which specifically help with deep learning applications and workflows:\r\n<h6><\/h6>\r\n<ul>\r\n \t<li>Live Editor Tasks<\/li>\r\n \t<li>Execute Python functions out of process<\/li>\r\n \t<li><span style=\"font-family: courier;\">tiledlayout<\/span> is the new <span style=\"font-family: courier;\">subplot<\/span><\/li>\r\n \t<li>App Designer updates<\/li>\r\n \t<li>Function input argument validation<\/li>\r\n<\/ul>\r\n<h2>Live Editor Tasks<\/h2>\r\nThese are like mini-apps that you can embed in a Live Script and are very useful for preprocessing data, which is super important in DL. These are intended to help with tasks that are very iterative and visual. For example, in the Smooth Data task (pictured below) you can choose different parameters like the smoothing method, immediately visualize the results, and keep doing that until you find a method appropriate for your data. There are Live Editor Tasks for common data cleaning needs like: missing data, outliers, smoothing, detrending, change point detection, and joining tables.\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" width=\"1854\" height=\"639\" class=\"alignnone size-full wp-image-2878\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2019\/09\/livededitor.png\" alt=\"\" \/>\r\n<h6><\/h6>\r\nLive Editor\/ Live Scripts are very useful in Deep Learning in general, since they are so great for communicating \u2013 capturing code, output, documentation, equations, images, etc. And communication is such an important thing in DL.\r\n<h6><\/h6>\r\nMore info on live editor tasks: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/add-live-editor-tasks-to-a-live-script.html\">https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/add-live-editor-tasks-to-a-live-script.html<\/a>\r\n<h6><\/h6>\r\n<h2>Execute Python functions out of process<\/h2>\r\nYou\u2019re often using multiple deep learning models, trying different models and examples from the community, and sometimes you need to use MATLAB and Python together. You have the model sharing options via ONNX, TF importers, etc., but you can also call Python libraries directly from MATLAB and vice versa. This has been around for several years now and we\u2019re continuously improving it. This release we include an option to run Python functions in a separate process to avoid library conflicts. So, if you ever have conflicts or crashes when calling TensorFlow, PyTorch, etc from MATLAB in the same process, you can use a separate process by setting this in the pyenv function:\r\n<h6><\/h6>\r\n<code>pyenv(\"ExecutionMode\",\"OutOfProcess\")<\/code>\r\n<h6><\/h6>\r\n<h6><\/h6>\r\nMore info on Python Functions: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_external\/out-of-process-execution-of-python-functionality.html\">https:\/\/www.mathworks.com\/help\/matlab\/matlab_external\/out-of-process-execution-of-python-functionality.html<\/a>\r\n<h6><\/h6>\r\n<h2>tiledLayout is the new subplot<\/h2>\r\nVisualizations are really important in DL- you\u2019re always plotting results, comparing classes, layer activations, etc. You also need to share your results, publish, and often customize visualizations.\r\n<h6><\/h6>\r\nNow you can use <span style=\"font-family: courier;\">tiledlayout<\/span> + <span style=\"font-family: courier;\">nexttile<\/span> instead of subplot when creating multiple plots in the same figure.\r\n<h6><\/h6>\r\n<code>tiledlayout(2,1,\"TileSpacing\",\"compact\"); nexttile; plot(rand(10,1)); nexttile; plot(rand(10,1),'m*')<\/code>\r\n\r\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-2894 size-full\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2019\/09\/tiled_updated1-e1568997105118.png\" alt=\"\" width=\"567\" height=\"413\" \/>\r\n\r\nThe syntax is nicer, but it's also more powerful than subplot. You can control spacing between axes, the resize behavior, etc and it\u2019s easy to use different sized axes in same figure and arrange for publications, like the example below.\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" width=\"702\" height=\"632\" class=\"alignnone size-full wp-image-2896\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2019\/09\/tiled_updated2.png\" alt=\"\" \/>\r\n<h6><\/h6>\r\nMore info on tile layout: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/tiledlayout.html\">https:\/\/www.mathworks.com\/help\/matlab\/ref\/tiledlayout.html<\/a>\r\n<h6><\/h6>\r\n<h2>Lots of App Designer features<\/h2>\r\nApp Designer is a user-friendly app authoring environment. It works well for sharing DL applications with others, even creating web apps using your model. It continues to improve each release and now you can make your app look better than ever in R2019b (lots of cosmetic-related functionality allow for customizing the look of your apps):\r\n\r\n&nbsp;\r\n<h6><\/h6>\r\n<ul>\r\n \t<li>Use <strong>uistyle<\/strong> to create styles for rows,\r\ncolumns, or cells in a table UI component<\/li>\r\n \t<li>Use <strong>uihtml<\/strong> to add HTML, JavaScript,\r\nor CSS content to apps<\/li>\r\n \t<li>Sort table UI components interactively when\r\nusing logical, numeric, string, or cell arrays<\/li>\r\n<\/ul>\r\nFor example, the below app was created with R2019b.\r\n<h6><img decoding=\"async\" loading=\"lazy\" width=\"694\" height=\"629\" class=\"alignnone size-full wp-image-2876\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2019\/09\/appdesigner2.png\" alt=\"\" \/><\/h6>\r\nMore info on App Designer: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/app-designer.html\">https:\/\/www.mathworks.com\/help\/matlab\/app-designer.html<\/a>\r\n<h6><\/h6>\r\n<h2>Function input argument validation<\/h2>\r\nYou often write functions in deep learning, especially when applications get more complicated and you need to better organize your code. You\u2019d like to give some restrictions on what can be passed to the function (for example, you expect an image (matrix) but someone passes a table). You could always do this input validation, but it required if statements and type checking, more customized error handling (just more coding, not hard but tedious). Now it\u2019s much easier on the developer to specify input requirements so they can spend more time writing the code for their actual algorithm, not fussing about argument checking and validation.\r\n<h6><\/h6>\r\n<code>arguments\r\n   width  (1,1) double {mustBeNumeric}\r\n   height (1,1) double {mustBeNumeric}\r\n   xStart (1,1) double {mustBeNumeric} = 0 % optional\r\n   yStart (1,1) double {mustBeNumeric} = 0 % optional\r\nend\r\n<\/code>\r\n<h6><\/h6>\r\nMore info on argument validation: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/function-argument-validation-1.html\">https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/function-argument-validation-1.html<\/a>\r\n<h6><\/h6>\r\nThese are just a few of my favorite highlights for deep learning, but there\u2019s much more! Check out the release notes and overview pages for additional updates.\r\n<h6><\/h6>\r\n<h6><\/h6>\r\n<span style=\"font-family: courier;\">Thanks again to Heather for keeping us up-to-date in MATLAB. Got a question for Heather? Have a specific new feature you love in MATLAB? Leave a comment below.<\/span>\r\n<h6><\/h6>\r\n<a href=\"https:\/\/twitter.com\/HeatherGorr\">Follow Heather on Twitter<\/a>!\r\n<h6><\/h6>\r\n<a href=\"https:\/\/twitter.com\/jo_pings\">Follow Johanna on Twitter<\/a>!\r\n<h6><\/h6>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2019\/09\/livededitor.png\" onError=\"this.style.display ='none';\" \/><\/div><p>This post is from Heather Gorr - MATLAB product marketing - here to talk about the new release of R2019b and new MATLAB functionality related to deep learning. You can get a high level overview of... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2019\/09\/20\/whats-new-in-19b-matlab\/\">read more >><\/a><\/p>","protected":false},"author":156,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/2850"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/users\/156"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/comments?post=2850"}],"version-history":[{"count":34,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/2850\/revisions"}],"predecessor-version":[{"id":2932,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/2850\/revisions\/2932"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media?parent=2850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/categories?post=2850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/tags?post=2850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}