MATLAB R2022a was released this week and, as I have done for the previous two releases (R2021a, R2021b), I would like to highlight the features that I am most excited about.

As usual, it has been hard to come up with this list. I have had to leave out many new features that I am truly eager about… Do not forget to check the release highlights with 5 new products and release notes to learn about updates to your favorite products.

10. pcode

For all my years at MathWorks, every once in a while, I have been approached by users regarding pcode obfuscation. Protecting IP has always been a topic of interest for MATLAB users. MATLAB R2022a now includes the option to create a P-code file using a more complex obfuscation algorithm.

pcode myfunc -R2022a

Although this is extremely simple, consider combining several approaches to protect your code or data. Check these Security considerations to protect your code.

9. Taylor Pruning

Deploying Deep Neural Networks to embedded systems can become a challenging problem, especially if the network doesn’t fit in your device. There are several model compression techniques that may be useful in this regard. Pruning allows to reduce the memory footprint of the network and thus increase inference speed, by removing whole filters in the network, making it less wide.

Comparing numbers of filters from original and pruned network You may also compare the accuracy of the original and the pruned network: Confusion Chart - Original Network Confusion Chart - Pruned Network

Check taylorPrunableNetwork for more details on how Taylor Pruning works or visit these examples (1, 2) to learn more.

8. Updates to Machine Learning Apps

Classification and Regression Learner Apps, which I have highlighted in the past (1, 2) have been profoundly updated in 2022a, including:

  • Save current session and open a previously saved session
  • Reserve a percentage of imported data for testing
  • Feature ranking algorithms to select predictors
  • Create several draft models
  • Use model summary to change model options and view model results
  • Train all draft models (including training in parallel)

Additionally, there are updates specific to Classification and Regression Learner.

Out of all the previous Machine Learning Apps updates, my top choice is having the possibility to use feature ranking algorithms to select predictors. By using various feature ranking algorithms, you may rank features by importance scores and select features in auto/manual mode. Ranking Features in Classification Learner

7. Publish a MATLAB function as a Docker container microservice

MATLAB Compiler SDK facilitates now the creation of a Microservice Docker Image using compiler.package.microserviceDockerImage. After packaging your MATLAB function into a Microservice Docker Image, you can run the microservice myfunc:

docker run --rm -p 9900:9910 myfunc

and then test the running service using curl, Postman, Thunder Client, etc.

curl -v -H Content-Type:application/json -d '{"nargout":1,"rhs":[4]}' http://hostname:9900/myfuncarchive/myfunc

Learn more

6. Training with heterogeneous multi-input networks

The trainNetwork function now supports layer graphs with mixtures of ImageInputLayer, Image3DInputLayer, SequenceInputLayer, and FeatureInputLayer layer objects. When using the trainNetwork function, the network must have at most one sequence input layer.

Multi-input network

5. User-Authored Live Tasks

Live Editor tasks are simple point-and-click interfaces that can be added to a live script to perform a specific set of operations. MATLAB and different toolboxes include several of these tasks to facilitate and streamline development.

Starting in MATLAB 2022a, you can author your own Live Task. I have worked extensively with this new feature. I will likely share more about this in a future post.

4. Network Analyzer updates

This may seem like a very small update to some of you. I find this as one of those updates that deeply simplify your life (if working in Deep Learning). Network Analyzer allows you now to the activation dimension labels and the total number of learnable parameters of a network. Each activation dimension has one of the following labels:

  • S — Spatial
  • C — Channel
  • B — Batch observations
  • T — Time or sequence
  • U — Unspecified

Network Analyzer

3. Python syntax highlighting

The MATLAB Editor has been updated to make viewing and editing Python files much easier. The Editor now displays Python files with syntax highlighting for keywords, strings, comments, and errors. In addition, the Editor auto-indents Python files and indicates matched and mismatched delimiters such as parentheses, brackets, and braces.

Before and after (MATLAB Editor before and after MATLAB R2022a)

2. Dark theme in MATLAB Online

Oh yes! You can now change the colors of the MATLAB Desktop using themes. Go to Preferences > MATLAB > Appearance and set the theme to Dark MATLAB Online Preferences

You may now continue your development from the dark side. MATLAB Online Dark Theme

1. MATLAB Deep Learning Model Hub

You can find the latest pretrained MATLAB deep learning models in the new MATLAB Deep Learning Model Hub. Finally, a one-stop place to search for suitable MATLAB models for a range of deep learning applications, including lidar point cloud processing, audio speech to text, pose estimation, etc.

MATLAB Deep Learning Model Hub

Comments