Circular Audio Wave — JS Library for Audio Visualization in Circular Waveform
Visualizing the data in a dynamic and continuous way gives the real-time feeling to be in sync with the data status, especially true for audio. I was looking for a JS library for circular audio wave, which was in a form of a circular continuous line that changed when the audio frequency changed, but I couldn’t find one. There is a great list of audio visualization libraries on github called awesome-audio-visualization. I couldn’t find anything that fit my need there. Therefore, I decided to create a library for this purpose.
I have been using a great canvas charting library called ECharts, created by Baidu, for my current company. It is very powerful and easy to use, and suitable for big data rendering. It has a wide range of charts like line, bar, pie, scatter, etc.
In order to make a circular continuous line, I took a look at the options of line chart. There’s a setting of the coordinate system — cartesian2d or polar. Polar was obviously the system I needed. I added data points with the same radius and incremental angle starting from 0 to 361. The reason of the 361st point was to fill the gap between 0th and 360th points. And it looked better with some color gradient on.
At this point, it could actually fulfill my initial purpose already, by feeding data into it using Web Audio API. The radius and angle would be the frequency level and index of the result from getByteFrequencyData(). That just seemed too easy.
I thought there could be more that I could do, so I researched on existing audio reactive visualization. There’s one common feature that I could add — maximum frequency bar (I called it “max bar”).The max bar records the maximum frequency and acts as a ceiling. Its record gradually decreases over time, until a current frequency that’s higher than the record appears, then it will use the higher frequency as a new ceiling. This helps visualize the difference of the frequency level from the recent maximum.
A max bar, acting as a ceiling, would be another circular line except that it’s always in a smooth shape. I added another polar line chart with the logic described above, rendered in greenish blue.
There was a lot of empty space at the center. It could be used to display more information about the audio. There’s also one more attribute of the audio that’s commonly used — tempo. I found José M. Pérez’s research about tempo detection in JavaScript, which would be the feature I wanted. However, I didn’t want to put a text there and showed the current bpm (beat per minute). That would not match my purpose of audio visualization. So I used another chart type for this — EffectScatter.
EffectScatter is a scatter chart that provides ripple effect to the data points. I added one big data point at the center, added ripple effect to it with gradient color. The speed of the ripple is based on the tempo of the audio. Here is the final result.
This looked great to me after adding the rippling point. I was satisfied with this design. It provided the information of the frequency levels at different data point and tempo of the audio.
I also tried it with another chart type sunburst. It’s supposed to be label text for the outermost layer, but that’s what I didn’t want. Thus I put empty string into there and add background color to these text so it looks like bars.
This library is not supported for IE, because they don’t have Web Audio API. The source code of this library is on Github.
What is the Difference Between the macOS and Linux Kernels
Some people might think that there are similarities between the macOS and the Linux kernel because they can handle similar commands and similar software. Some people even think that Apple’s macOS is based on Linux. The truth is that both kernels have very different histories and features. Today, we will take a look at the difference between macOS and Linux kernels.
History of macOS Kernel
We will start with the history of the macOS kernel. In 1985, Steve Jobs left Apple due to a falling out with CEO John Sculley and the Apple board of directors. He then founded a new computer company named NeXT. Jobs wanted to get a new computer (with a new operating system) to market quickly. To save time, the NeXT team used the Mach kernel from Carnegie Mellon and parts of the BSD code base to created the NeXTSTEP operating system.
NeXT never became a financial success, due in part to Jobs’ habit of spending money like he was still at Apple. Meanwhile, Apple had tried unsuccessfully on several occasions to update their operating system, even going so far as to partner with IBM. In 1997, Apple purchased NeXT for $429 million. As part of the deal, Steve Jobs returned to Apple and NeXTSTEP became the foundation of macOS and iOS.
History of Linux Kernel
Unlike the macOS kernel, Linux was not created as part of a commercial endeavor. Instead, it was created in 1991 by Finnish computer science student Linus Torvalds. Originally, the kernel was written to the specifications of Linus’ computer because he wanted to take advantage of its new 80386 processor. Linus posted the code for his new kernel to the Usenet in August of 1991. Soon, he was receiving code and feature suggestions from all over the world. The following year Orest Zborowski ported the X Window System to Linux, giving it the ability to support a graphical user interface.
Over the last 27 years, Linux has slowly grown and gained features. It’s no longer a student’s small-time project. Now it runs most of the world’scomputing devices and the world’s supercomputers. Not too shabby.
Features of the macOS Kernel
The macOS kernel is officially known as XNU. The acronym stands for “XNU is Not Unix.” According to Apple’s Github page, XNU is “a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and C++ API for writing drivers”. The BSD subsystem part of the code is “typically implemented as user-space servers in microkernel systems”. The Mach part is responsible for low-level work, such as multitasking, protected memory, virtual memory management, kernel debugging support, and console I/O.
Features of Linux Kernel
While the macOS kernel combines the feature of a microkernel (Mach)) and a monolithic kernel (BSD), Linux is solely a monolithic kernel. A monolithic kernel is responsible for managing the CPU, memory, inter-process communication, device drivers, file system, and system server calls.
Difference between Mac and Linux kernel in one line
The macOS kernel (XNU) has been around longer than Linux and was based on a combination of two even older code bases. On the other hand, Linux is newer, written from scratch, and is used on many more devices.
Deep Learning has become the go-to method for solving many challenging real-world problems. It’s by far the best performing method for things like object detection, speech recognition, and language translation. Many people see Deep Neural Networks (DNNs) as magical black boxes where we shove in a bunch of data and out comes our solution! In practice, things actually get a lot more complicated…
There can be a whole host of challenges in designing and applying a DNN to a specific problem. To achieve the performance standards required for real-world application, proper design and execution of all stages in the pipeline are crucial including data preparation, network design, training, and inference. Here I’m going to share with you 7 practical tips for getting the most out of your Deep Neural Net.
1 — Data, data, data
This one’s no big secret. The deep learning machines that have been working so well need fuel — lots of fuel; that fuel is data. The more labelleddata we have, the better our model performs. The idea of more data leading to better performance has even been explored at a large-scale by Google with a dataset of 300 Million images!
When deploying your Deep Learning model in a real-world application, you should really be constantly feeding it more data and fine tuning to continue improving its performance. Feed the beast: if you want to improve your model’s performance, get some more data!
2 — Which optimizer should you use?
Over the years, many gradient descent optimization algorithms have been developed and each have their pros and cons. A few of the most popular ones include:
Stochastic Gradient Descent (SGD) with momentum
Adam
RMSprop
Adadelta
RMSprop, Adadelta, and Adam are considered to be adaptive optimization algorithms, since they automatically update the learning rate. With SGD you have to manually select the learning rate and momentum parameter, usually decaying the learning rate over time.
In practice, the adaptive optimizers tend to converge way faster than SGD; however, their final performance is usually slightly worse. SGD usually achieves a better minimum and thus better final accuracy, but it might take significantly longer than with some of the optimizers. It’s also much more reliant on a robust initialization and learning rate decay schedule, which can be quite challenging to tune in practice.
Thus, if you’re in need of some quick results or just want to test out a new technique, go with one of the adaptive optimizers. I’ve found Adam to be very easy to use as it’s not very sensitive to you selecting the perfect learning rate. If you want the absolute best final performance, go with SGD + Momentum and work with the learning rate, decay, and momentum value to maximize the performance.
Getting the best of both worlds
It’s recently been shown that you can get the best of both worlds: high-speed training with top notch performance by switching from Adam to SGD! The idea is that the early stages of the training is really the time when SGD is very sensitive to parameter tuning and initialization. Thus, we can start off our training by using Adam, which will get you pretty far while not having to worry about initialization and parameter tuning. Then, once Adam has got us rolling, we can switch to SGD + Momentum optimization to achieve peak performance!
3— How to handle imbalanced data
There are many cases where you will be dealing with imbalanceddata, especially in real-world applications. Take a simple but real-world example: You are training your deep network to predict whether someone in a video feed is holding a lethal weapon or not, for security reasons. BUT in your training data, you only have 50 videos of people holding weapons, and 1000 videos of people without weapons! If you just train your network right away with this data, your model will definitely be highly biased towards predicting that no one ever has a weapon!
There are a few things you can do to combat this:
Use classweights in the loss function. Essentially, the under-represented classes receive higher weights in the loss function, such that any miss-classifications for that particular class will lead to a very high error in the loss function.
Over-sample: Repeating some of the training examples that contain the under-represented class helps even-out the distribution. This works best if the available data is small.
Under-sample: You can simply skip some training examples that contain the over-represented class. This works best if the available data is very large.
Data augmentation for the minority class. You can synthetically create more training examples for the under-represented class! For example, with the previous example of detecting lethal weapons, you can change some of the colours and lighting of the videos that belong to the class having lethal weapons.
4 — Transfer Learning
As we looked at in the first tip, deep networks need lots of data. Unfortunately, for many new applications, this data can be difficult and expensive to acquire. We might need tens or hundreds of thousands of new training examples to train on if we want our model to perform well. If a data set is not readily available, it must all be collected and labelled manually.
That’s where transfer learning comes into play. With transfer learning, we don’t need a lot of data! The idea is to start off with a network that was previously trained on millions of images, such as ResNet pre-trained on ImageNet. Then we will fine-tune the ResNet model by only re-training the last few layers and leaving the others alone. That way, we are taking the information (image features) that ResNet learned from millions of images and fine-tuning it such that we can apply it to a different task. This is possible because the feature information of images across domains is often quite similar, but the analysis of these features can be different depending on the application.
5 — Quick and easy data augmentation to increase performance
We’ve said it a few times now: more data = better performance. Aside from transfer learning, another quick and easy way to increase your model’s performance is data augmentation. Data augmentation involves generating synthetic training examples by altering some of the original images from the data set, while using the original class label. For example, common ways of data augmentation for images include:
Rotate and/or flip the images horizontally and vertically
Alter the brightness and colours of the images
Randomly blur the images
Randomly crop patches from the images
Basically, you can perform any alteration that would change the look of the image, but not the overall content i.e you can make a picture of a dog blue, but you should still be able to clearly see that it’s a picture of a dog.
6 — Give your model a boost with ensembles!
In machine learning, ensembles train multiple models and then combine them together to achieve higher performance. Thus, the idea is to train multiple deep network models on the same task on the same data set. The results of the models can then be combined via a voting scheme i.e the class with the highest number of votes wins.
To insure that all of the models are different, random weight initializations and random data augmentation can be used. It is well known that an ensemble is usually significantly more accurate than a single model, due to the use of multiple models and thus approaching the task from different angles. In real-world applications, especially challenges or competitions, almost all the top models use ensembles.
7 — Speed it up with pruning
We know that model accuracy increases with depth, but what about speed? More layers means more parameters, and more parameters means more computation, more memory consumption, and less speed. Ideally, we would like to maintain high accuracy while increasing our speed. We can do this with pruning.
The idea is that among the many parameters in the network, some are redundant and don’t contribute a lot to the output. If you could rank the neurons in the network according to how much they contribute, you could then remove the low ranking neurons from the network, resulting in a smaller and faster network. The ranking can be done according to the L1/L2 mean of neuron weights, their mean activation, the number of times a neuron wasn’t zero on some validation set, and other creative methods. Getting faster/smaller networks is important for running deep learning networks on mobile devices.
The most basic way of pruning networks is to simply drop certain convolutional filters. This was done fairly successfully in this recent paper. The neuron ranking in this work is fairly simple: it’s the L1 norm of the weights of each filter. On each pruning iteration they rank all the filters, prune the m lowest ranking filters globally among all the layers, retrain and repeat!
A key insight to pruning filters was presented in another recent paper that analysed the structure of Residual Networks. The authors showed that when removing layers, networks with residual shortcut connections (such as ResNets) were far more robust in maintaining good accuracy than networks that did not use any shortcut connections (such as VGG or AlexNet). This interesting discovery is of great practical importance because it tells us that when pruning a network for deployment and application, the network design is of critical importance (go with ResNets!). So it’s always good to use the latest and greatest methods!
That’s a wrap!
There you have it, your 7 practical tips for Deep Learning!
We recently discussed the best Linux games on steam, but the best of all does not necessarily mean that they are all free. Instead, most of those were paid games. So, we thought of putting together a separate list of best free Linux games that you can play without spending a penny.
Before we see the list of best free Linux games, let me tell you about Humble Bundle. It’s an awesome website that offers massive deals on games and books. The best part is that part of the sale goes to various open source projects and charities. You can visit their store to check the ongoing offers. If you can spend money, you can also subscribe to their monthly plan to get premium games for free and on additional discounts.
Now that you are aware of the awesome Humble Bundle, let’s have a look at the free Linux games. Just for your information, the games listed below are in no particular order of ranking.
1. Dota 2
Dota 2 is one of the most popular MOBA games available for Linux. Well, I’m not a fan of this game but if you like multiplayer strategy games, this should be the one you should have installed. Dota 2 offers one of the best competitive eSport opportunity for aspiring gamers.
The game is completely free to play – however – it offers a battle pass separately – if you want extra features and rewards, which is optional but it’s still something exciting if you are love to play Dota.
2. Team Fortress 2
Team Fortress 2 is one of the oldest multiplayer shooter game available for Linux. Even though the game was released in 2007, it still has a decent player base which makes it one among the top 10 steam games being played on a daily basis.
The game still receives regular content updates – so you shouldn’t get bored. It features a lot of game mods and also lets you customize and create your own character with hundreds of weapons to choose from. In case you were wondering, it isn’t a pay-to-win scheme – it’s just plain cosmetic items which should add a personal touch to your character.
3. War Thunder
War Thunder is a quite impressive World War II simulation game. It is a cross-platform MMO game that deals with aviation, armored vehicles, and naval craft from World War II and the Cold War.
Obviously, it’s an entirely different take on WWII and the Cold War focusing on the variety of combat vehicles used. Yes, it might just be a simple simulation game with multiplayer action – but it still boasts great graphics details in the game.
4. WAKFU
WAKFU is a grid-based MMORPG game which every anime fan would love to have installed. It is really an interesting free to play online strategy RPG game that has humor baked into it as well. The game features 18 different classes to choose from, and whatever role you pick, everything depends on it.
I would definitely want you to try this out – personally, I loved it.
5. Fishing Planet
Fishing Plant (as the name suggests) is an online first-person multiplayer fishing simulator. It’s not for everyone – but if you are an angler or maybe you just want to experience fishing (virtually) – this should be something you should get installed.
It is a very basic simulation game with pleasant graphics details to provide the best first person experience. The base game is free – however, you get several optional DLCs on Steam.
6. Star Conflict
If you want an action-drive space simulation game, this is probably one of the best Linux games for that kind of thing. Star Conflict is a massively multiplayer game which includes both PVP and PVE. You just need to survive in the outer space and decide the best strategy to engage on the enemies.
7. Robocraft
Want to have a fully customizable battle robot? – maybe, the Transformers? Well, Robocraft is something similar. It lets you set up your own robot battle vehicles that can drive, hover, walk or fly – as per your preferences. A bunch of futuristic weapons to choose from – that’ll make the battle even more interesting. It is one of the latest free Linux games that you should try.
8. AdVenture Capitalist
Thought about becoming a capitalist? Well, there’s no better capitalism simulator than this for your Linux machine. Invest, prosper, and attract Angel investors to give your business a boost. Hire a manager and keep your business stable while you’re gone!
9. BRAIN / OUT
Brain / Out is a 2D multiplayer shooter with a post-soviet setting. I don’t really try 2D games but this one was definitely something exciting. You can customize your loadout as well and progress through the game to utilize every type of powerful weaponry to defeat your enemies.
10. Wild West Saga: Idle Tycoon
The game revolves around the Wild West, where you get the chance to become a billion-dollar pioneer by starting several businesses and exploring more business opportunities. The more patent cards you collect, the more it would help your business with new towns and upgrades.
11. No More Room in Hell
If you are a true gamer who loves an action-packed game, you will surely love zombie shooter games. No More Room in Hell is one such first-person co-op zombie shooter game that is completely free to play on Steam.
It is no ordinary FPS game, but also has the touch of a horror game (like the classic Left 4 Dead – which isn’t available for Linux)
12. Awesomenauts
A side-scrolling hero-based 2D MOBA game is damn impressive. It definitely is one of the free Linux games that we would recommend you to try. You can join your friends as an online party or you could enjoy it on a local split screen as well.
I must say, this game is superbly good – if you’re into 2D action-packed games.
13. Dead Maze
Yet another 2D game but with zombies in it. You need to craft life-saving supplies, collect food, monitor health, and scavenge for resources to survive the zombie apocalypse. It is a multiplayer game where you have to cooperate and join other players to survive the apocalypse.
14. The King’s Request: Physiology and Anatomy Revision Game
A dead simple 2D short adventure game which tests your knowledge of the human body, and concepts from science, biology, physiology, anatomy, medicine, Biomed, nursing, pharmacy, health or exercise science.
Each correct answer leads you to the victory and saves the kingdom. And, there are no negative points if you get an answer wrong.
Of course, this isn’t a great game to talk about – but this game is an example of gamifying learning content – so why not give it a try?
15. Cognizer
A unique puzzle game that challenges your brain with symbols and colors. You can either set a time limit or remove it to make things easier.
16. Faeria
It is an interesting card game where you need to defeat your opponent in epic battles. You can either enjoy the game solo or join a casual/competitive multiplayer match. Faeria is nothing like any other card game and that makes it one of the free Linux games we would recommend you to try.
17. Tank Force
If you were searching for an online tank shooter game, Tank Force is a quite good addition to your Steam library. It features a lot of different tanks which you need to unlock as you level up. Join the players from all over the world to fight for dominance.
Tank Force supports cross-platform PvP battles (10v10) with a variety of battle modes and combat arenas. Do try it out!
18. Toribash
Toribash is a unique online turn-based fighting game. Here, you have the ability to design your own moves. You get complete control over your character’s body with hundreds of potential game mods available.
If you were looking for something original and unique – Toribash is the one.
19. Forge of Gods
Forge of Gods is a multiplayer card strategy game where you need to collect and train as many monsters as you can and then assemble them to attack! You even get the ability to mix different type of creatures to breed legendary warriors. In addition, it also features boss battles!
20. World of Guns: Gun Disassembly
Yet another interesting game which lets you explore a wide range of firearms – that includes disassembling/assembling them. There’s nothing more to talk about it – but it’s enjoyable.
21. The Pirate: Caribbean Hunt
Sail through epic battles and raids to become the undisputed captain! The Caribbean is full of opportunities, you just have to find them!
In other words, be the jack sparrow! (maybe that’s too much to ask for)
22. Xonotic
Xonotic is a fast-paced arena shooter. You will probably like it if you’re missing out games like Quake Champions on Linux. It features a pretty impressive set of weapons – that will decide your fate in the arena.
Indeed one of the best free Linux games that do not require Steam.
23. The Battle for Wesnoth
The Battle for Wesnoth is an open-source free turn-based strategy game. You can opt to play it solo or consider joining the multiplayer sessions. You’ve got to defend your kingdom. In either case, you can even choose to pursue the unseen evil by heading down to an adventurous path.
24. CAYNE
It is a point-n-click horror adventure game and it’s free to download via GOG.com. It offers optional extra content for a certain price – but you won’t really be needing that unless you absolutely love this game.
25. 0 A.D
0 A.D. is a free, open-source real-time strategy game that deals with ancient warfare. A group of independent game developers regularly release newer Alpha versions of the game (currently with the 23rd). You can even download mods from within the game to enhance your gameplay.
26. Urban Terror
Urban Terror is a free multiplayer FPS game with a decent number of active players (it depends on your location). It is somewhat relatable to Counterstrike 1.6 but it’s fun if you have friends to play with.
27. Secret Maryo Chronicles
Want a free Super Mario rip-off that’s unique in its own ways? Well, we’ve got you this.
Maryo Chronicles is one of the most amazing 2D side sidescroller games. It is not being actively maintained, but you could give it a try.
28. Assault Cube
Yet another something like the classic Counterstrike 1.6. Assault Cube is a pretty good multiplayer FPS game if you have enough players in the servers. It’s not entirely the best multiplayer FPS but it still is enjoyable.
29. Super Tux Kart
If you are a fan of Kart racing games like the Beach Buggy Blitz for the mobile platform or Mario Kart for Nintendo – you will definitely like this game. It’s super simple, with optimized controls to handle your kart and enjoy the race!
30. Warsow
Warsow is a well-thought FPS game. It is unique and interesting. They even have a discord server which you join and find other players to play with.
31. Hedgewars
It is a funny turn-based strategy game featuring pink hedgehogs. It’s a package of comedy, action, strategy, and artillery – as a whole. It is one of my favorite free Linux non-steam games available.