Adopting linux as primary OS

Image Source: Forbes.com

Linux distros are being used by researchers, engineers, scientists and doctors among many other professionals. Linux is omni present, in servers providing critical cloud services, in desktops running scientific computations and for day-to-day use. Recently, the Indian state of Kerala where I am originally from, saved $400 million by choosing linux computers as the operating system for school computers under a state-wide project. Similar pattern of adoption of Linux as

Recently, more and more people especially with background is data science and machine learning are making use of Linux distros as their primary desktops. Newer distros with more advanced features are being developed to enable better performance and ease of use for faster adoption and transition. The most recent of them is the Clear Linux project developed by Intel which provides developers and data scientist the capability to develop cutting edge machine learning applications and at the same time use it can be used as a regular desktop OS. Users of Ubuntu, Fedora, elementary OS and Linux Mint would find it a similar environment but with a different way of managing packages in bundles rather than the traditional package managers used in Debian or Red hat based systems.

The surge in Linux usage can be attributed to Zero or low cost, ability to develop software and perform complex scientific computations with ease.

Management – Changing landscape and its vitality for a professional

Photo by Hunters Race on Unsplash.com

One of the significant realizations that inspired me to write this post is the realization that most professionals become leaders such as managers in most parts of their careers. Most of them, no matter how old they are, cannot manage people in the changing landscape. What was considered effective a decade ago, may not be effective today.

An inherently participative model drives modern-day team leadership unlike the hierarchical model of the industrial age. Organizations are performing research into the effective management of workplace today dominated by millennials. A hierarchical model where followers are asked to do specific things without critique and critical thinking are things of the past. The stick-and-carrot model of past can do more harm in the modern day than benefiting the company or a leader.

The leader-follower relationship quality prediction started in the 1980’s through the vertical-dyadic theory.The theory investigates the relationship building over a period, predicting how good a leader can be. We can broadly classify the relationship of followers with the leader as in-group and out-group. In in-group members have a higher affinity with the leader with better communication, and they praise each other. In out-group, the members are imposed or told what to do without two-way communication. LMX (Leadership exchange theory) is an improved version of the dyadic theory, where there is a continuum of the relationship between leaders and followers. There are cases where followers have high interaction with leader and situations where the leader has formal communication. As a follower, a person can take steps to get from out-group to in-group, and it is not always up to the leader to take steps. A leader can influence a follower in a way that is beneficial for the team and the organization, which is known as influencing organizational citizenship behavior (OCB). This leads to the follower taking more than what the job description states and ensuring high-quality exchange between the leader and the followers. A leader has a certain span of control which can be used to influence the followers to behave this way. The more OCB we have in the high-quality network, then the higher the performance of the company. There is also the social identity component when people identify that they are a part of the company. The way the organization behaves becomes a part of who they are and how they describe themselves, and which in turn leads them to perform better. 

As a team leader, to bring followers into the in-group from out-group, one must try building bonds with open communication and appreciation of their efforts. Influencing organization citizenship behavior within the leader’s span of control would lead them to perform better and providing them with the social identity, and higher purpose of their work would inspire them to work closely with the team and leader. In addition to this, researchers have found out that when a leader or a set of people believe that a group of people can work effectively, setting high expectations, they would inturn become high performers. This is otherwise called the Pygmalion effect – the phenomenon whereby higher expectations lead to an increase in performance. It is hence vital to ensure that high expectations of colleagues or followers, else the thought of low expectations would lead to low performing employees. Psychological safety is one of the most critical factors of effective and top performing teams as identified by Google. A leader must ensure psychological safety, providing an open line of communication and ensuring their opinions are valued without repercussions to their ideas and critiques. Convert disengaged people to show out their potential and through active participation and demonstration of the cognitive and emotional self. Acknowledging uncertainty, interdependence, encouraging critique, idea exchange and modeling curiosity through questions should be the given importance at the workplace.

The four of the most valuable things to ensure success in the future workplace is psychological safety, creativity, critical thinking and cognitive flexibility (or the ability to see the problem from multiple viewpoints).

The lack of large reliable data sets in fluid dynamics for deep learning

Fluid flow method using regression forest method by Ladicky et. al (Source)

Deep learning has gained prominence in varied sectors. Fluid dynamics simulations and experiments have also been explored to improve predictions over the past few years.

Ladicky et. al has explored a novel idea combining machine learning with fluid dynamics simulation. Here they made use of physics-based simulation as a regression problem, estimating the acceleration of every particle in every frame. The created a feature vector, directly modeling individual forces and constraints from the Navier-Stokes equations, predicting reliably the positions and velocities of particles in large time step on an unseen test video. A large training set of simulations obtained using traditional solvers were used for training using regression forest to obtain an approximate behavior of particles. Simulations like these reduce the need for computational resources for high-resolution real-time simulation.

“Given the inherent difficulties of long-term predictions, our vision for CFD in 2030 is grounded on a desired set of capabilities that must be present for a radical improvement in CFD predictions of critical flow phenomena associated with the key aerospace product/application categories, including commercial and military aircraft, engine propulsion, rotorcraft, space exploration systems, launch vehicle programs, air-breathing space-access configurations, and spacecraft entry, descent, and landing (EDL). “- NASA’s CFD Vision 2030 Study: A Path to Revolutionary Computational Aerosciences (NASA/CR–2014-218178

Modern day simulations in fluid dynamics have reached its pinnacle with traditional turbulence modelling. In NASA’s CFD Vision 2030 Study: A Path to Revolutionary Computational Aerosciences (NASA/CR–2014-218178) report the most critical area in CFD simulation capability that will remain a pacing item by 2030 will be the ability to adequately predict viscous turbulent flows with possible boundary layer transition and flow separation present.

But modeling knowledge and predictive capabilities can be built only on the basis of good data under varied conditions. The single thing that the fluid dynamics community suffers in the lack of reliable data under different conditions and for different applications. Training, algorithms, modeling techniques and machine learning approaches are secondary to develop data-driven turbulence modeling capabilities. This necessitates a global repository or database of reliable data both experimental and computational, where researchers from around the globe can pool in data and can benefit researchers focused on data-driven fluid dynamic simulations. Such a repository would open up better capabilities of predicting fluid dynamics and understanding flow in varied areas of interest unlike anything seen in history.

Installing Tensorflow(GPU), OpenCV and dlib on Ubuntu 18.04 Bionic Beaver

https://www.tensorflow.org/

Image source: https://www.tensorflow.org/

For those who are ready for machine learning and computer vision with the updated versions of OpenCV, dlib, Tensorflow (GPU) on the Bionic Beaver.

Install synaptic and atom from Ubuntu’s package manager

sudo ubuntu-drivers autoinstall
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

search and install nvidia-390 from synaptic

Download CUDA 9.0 (It has to be 9.0 for Tensorflow 1.8):

https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704&target_type=runfilelocal

And Download cuDNN v7.1.3 for CUDA 9.0:

https://developer.nvidia.com/rdp/cudnn-download

sudo chmod +x cuda_9.0.176_384.81_linux.run
sudo chmod +x cuda_9.0.176.1_linux.run
sudo chmod +x cuda_9.0.176.2_linux.run
sudo ./cuda_9.0.176_384.81_linux.run --override
sudo ./cuda_9.0.176.1_linux.run
sudo ./cuda_9.0.176.2_linux.run

DO NOT INSTALL THE DRIVER AND SAMPLES IN THIS PART! Ignore the fact that they give you a warning for the driver not being installed. This is because the installer cannot detect the installed driver in your system, which we installed earlier through synaptic.

sudo apt-get install cuda-9
sudo apt-get upgrade
tar -zxvf cudnn-9.0-linux-x64-v7.1.tgz
sudo cp -P cuda/lib64/* /usr/local/cuda-9.0/lib64/
sudo cp  cuda/include/* /usr/local/cuda-9.0/include/
sudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h
sudo apt-get install libcupti-dev
sudo atom ~/.bashrc

And add these lines:

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

source ~/.bashrc
sudo apt-get update
sudo apt-get install build-essential cmake libopenblas-dev liblapack-dev libx11-dev libgtk-3-dev python python-dev python-pip python3 python3-dev python3-pip

Download and install Anaconda Python 3.6 (I use 3.6 universally and 2.7 for scientific computations)

Create environment using an environment name (envname)

conda create -n envname python=2.7
source activate envname
pip install numpy pillow lxml jupyter matplotlib dlib protobuf
sudo apt -y install python-opencv
conda install -c conda-forge opencv 
sudo snap install protobuf --classic
pip install --upgrade tensorflow-gpu

To KILL process and clear memory of GPU:

nvidia-smi

and kill the process causing unwanted memory usage

sudo kill -20483 PID.

Ubuntu 18.04 LTS (Bionic Beaver) – A powerful platform for a multitude of applications

Source:fossbytes.com

Image source: fossbytes.com

The heavily revamped Ubuntu comes with GNOME shell instead of unity, Snap apps and a software center where (finally!) we don’t have to search the web for an updated version of any software! The team at Canonical has added many features which have made the platform easy to use and powerful for programming. Canonical’s LivePatch can be used for critical updates without the need for rebooting the computer. The only issue I found was the boot issue with my laptop post-installation. The following fix can be applied to solve the problem.

Fixing boot problems with Ubuntu 18.04 LTS (Bionic Beaver)

In BIOS:
Intel Virtualization Technology: Enabled
VT-d: Enabled
Hyper-threading: Enabled
CPU C states: Disabled
Fast Boot: Enabled
Boot mode select: UEFI
Secure Boot: Disabled
Secure Boot Mode: Standard

In: /etc/default/grub, change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi= acpi_backlight=none acpi=ht pci=nomsi"

Then run: sudo update-grub

The original work of M.J. Boussinesq published in 1913

Annals of Chemistry and of Physics - 1913

In was the search of the original article “The application of the formula for surface viscosity to the surface of a slowly falling droplet in the midst of a large unlimited amount of fluid which is at rest and possesses a smaller specific gravity” published by M.J. Boussinesq which was published in originally in French in the Annales de Chimie et de physique (Annals of Chemistry and of Physics) published in 1913. The paper formed the basis of the legendary Boussinesq-Scriven stress model. I found the volume of the scientific journal in a French library repository and is sharing the same here:

M.J. Boussinesq, “The application of the formula for surface viscosity to the
surface of a slowly falling droplet in the midst of a large unlimited amount
of fluid which is at rest and possesses a smaller specific gravity,” Ann. Chem.
Phys., vol. 29, pp. 357–364, 1913

Interesting publications in fluid dynamics using neural networks

Image source:  Oreilly – A look at deep learning for science

“Turbulence was probably invented by the Devil on the seventh day of Creation when the Good Lord wasn’t looking.” Peter Bradshaw (1994)

Recently, I came across a few interesting publications in fluid dynamics domain focusing on the use of neural networks. The use of neural networks is popular in varied areas including self-driving cars. The use of neural networks has started leaving its footprints in fluid dynamics, especially in turbulence modeling. A recent article in the Journal of Fluid Mechanics by José Nathan Kutz provided an overview of Deep learning in fluid dynamics.

The article mentions the publication by Ling et al. titled: “Reynolds averaged turbulence modelling using deep neural networks with embedded invariance“, as one of first to apply a true DNN architecture, specifically to Reynolds averaged Navier Stokes turbulence models. The paper by Ling et al. focuses on the fact demand for improved Reynolds-averaged Navier–Stokes (RANS) turbulence models that are informed by and can represent a richer set of turbulence physics, and the method they used to learn a model for the Reynolds stress anisotropy tensor from high-fidelity simulation data. The paper showed that the neural network architecture provided improved prediction accuracy  and significant improvement in comparison to baseline RANS linear eddy viscosity and nonlinear eddy viscosity, models.

In May 2017, Gamahara et al. published a paper in Physical Review Fluids titled: Searching for turbulence models by artificial neural network. The work  demonstrated the use of the artificial neural network (ANN) as a tool for finding a new subgrid model of the subgrid-scale (SGS) stress in large-eddy simulation. The paper concludes that the results confirm that the ANN is a promising tool for establishing a new subgrid model with further improvement.

These interesting research papers point to the growing importance of deep neural networks in the area of fluid dynamics and turbulence modeling. It was rightly said that by Peter Bradshaw that  “Turbulence was probably invented by the Devil on the seventh day of Creation when the Good Lord wasn’t looking.”  and maybe the advances in machine learning and neural networks, would provide at least some of the answers humans have been seeking for a long time. 

 

Jupyter Lab in the Azure platform

We all love the Jupyter notebooks for its intuitive and interactive interface. It  is one of the best interactive platforms for data analysis and scientific computation. I have executed numerous computation and analysis using python with Jupyter notebooks offline and on the cloud using AWS(Amazon Web Services). 

Recently, I started using the python with Jupyter notebooks on the Microsoft’s Azure platform, along with the newly released JupyterLab IDE. The JupyterLab IDE is a true Interactive development environment for effective computation. It comprises of a file browser, terminal and code editor, which reminds me of the Rodeo IDE.The Jupyter lab google drive feature also assists in realtime collaboration.

The ability scale and deploy on the azure platform, similar to the AWS and the Google cloud, enables computationally intensive applications to be performed with ease.

 

Check out the video below for an intro to JupyterLab:

Machine learning and artificial intelligence to improve scientific research 

Title image source: http://www.esanosys.com/

 

Most scientists come up with mathematical models that could be used to simulate physics. It was rightly said by George Box that “all models are wrong but some are useful”. A mathematical model is mostly based on considering a few conditions that make up the physical process and gives us results to some degree of accuracy given a number of controlled physical parameters or conditions.

The advent of machine learning and artificial intelligence is going to change the method of mathematical modeling, making it obsolete. The method of modeling of future will involve computational models which are generated in real-time, considering all the physical parameters associated with a physical process. The results: a complex computational model which is being updated in real-time, which can be used to predict with much accuracy the results we are looking for.

This method will not only put an end to multiple models with limited capability but also to ambiguity, bias and limitations of current models. The newer computation models will not be limited to a given condition but can be used in every condition.