Skip to main content

Posts

Showing posts from 2020

Artist got automated

Here is my first Tensorflow run to convert images to different styles of famous painters I am using the code that is available at  https://github.com/lengstrom/fast-style-transfer It uses specific versions of below libraries !apt install ffmpeg !pip install tensorflow==0.12.1 !pip install numpy==1.11.2 !pip install scipy==0.18.1 !pip install pillow==3.4.2 I started with latest version and that triggered failure after failure. If you are like me, add below changes to their respective files #This is to make tensorflow behave as if it is in v1 File : evaluate.py and ./src/transform.py import tensorflow.compat.v1 as tf tf.disable_v2_behavior() #Image functions are removed from scipy.misc module. so use imageio instead import imageio scipy.misc.imsave(out_path, img) --> imageio.imwrite(out_path, img) img = scipy.misc.imread(src, mode='RGB') --> img = imageio.imread(src, pilmode='RGB') Refer this post on more details on imageio changes Here is the ...

Covid19 - Travel restrictions and Impact on Auto Insurance Industry

This post intended to track impact on Auto Insurance Industry due to Travel restrictions. As of 4/6, All State and America Family insurance companies announced to reduce premiums and return payments already made. ValChoice , a data analytics companies estimating 70% savings by updating your change mode of transport from commute to pleasure driving. Irrespective of whether your Insurance provider transfers any savings in claims to individuals or not, since we arent driving much, it may be a good idea to change policy coverage to state minimum and reduce premium reduction immediately. If things change, you start driving again, Remember, you can always update your policy coverage.

Covid19 mitigation strategy

As anticipated Lock downs aren’t a viable solution for long. Across the worlds, all Govt feel pressure to lift restrictions. Below is a strategy addressing it End Goal : No Active cases of people infected with COVID19 in the community or everyone in the community are Recovered Stage 1 A new infectious virus is identified outside community. No known infection in the community ( Measure : first case reported date) All the travel from outside to the community is restricted ( Measure : data of restrictions) All incoming people are screened for virus infection and quarantined immediately ( Measure : Screening / Testing strategy) Stage 2 : Contact tracing People travel from outside the community, found to be Virus infected later on. Contact tracing begins. All the people in contact with infected persons are quarantined for testing. Contact tracing goes for people of indirect contact and Restrictions put in places where the infected person may have travelled w...

Understanding Covid19

Test, Trace and Isolate  Some articles / videos that helped me understand Covid19 better are documented here for others Read Peter Kruger 's answer to Why is COVID-19 considered a deadly virus even though only 15,000 people have died? on Quora Want to see the true potential impact of ignoring social distancing? Through a partnership with @xmodesocial , we analyzed secondary locations of anonymized mobile devices that were active at a single Ft. Lauderdale beach during spring break. This is where they went across the US: pic.twitter.com/3A3ePn9Vin — Tectonix GEO (@TectonixGEO) March 25, 2020 Effectiveness of local lock down and closing down boarders Read John Light 's answer to Some researchers are indicating that the epidemiology of COVID-19 is following a graph-theoretic "small world" model rather than a classic exponential model; do you agree, and how does this bode for the disease progression in the U.S.? on Quora Expl...

My Thoughts on Corona virus #COVID19

Based on Corona virus ability to stay undetected (with no symptoms) while keep spreading is going to keep this virus alive for a long time to come . Let that sink for a min As we dont have a cure yet, social distancing, can only slow down its spread but cant eradicate it completely. If social distancing sounds too silly for you, check this video to understand how effective it is. So its not IF but WHEN , one is going to be infected . By practicing social distancing, we are effectively buying more time and protecting someone vulnerable, could be our loved one. During this time, lets hope More people dont get infected, crushing Medical infrastructure Virus dont mutate into some other form Get a cure to the virus or a vaccine (with mild virus) to train our immune system. -------------------------------------------------- On consequences Of those infected, elderly and folks with weak immune system are most at life risk. Remaining others will get recover...

Weight loss - Muscle building - Protein

Why you need Protein ? Thermogenesis is the natural increase in the energy your body uses after eating. Protein causes a  higher rate of dietary thermogenesis  than other nutrients — research in the  Nutrition & Metabolism  journal explains that eating protein can actually allow the body to blast through up to  20-30% more calories than carbohydrates or fat The government recommends that the baseline requirements for adults is 0.75g of dietary protein per kilogram of bodyweight per day To  maximize muscle growth , research from the  Journal of Sports Sciences  recommends consumption of between: 1.3-1.8g per kilogram of bodyweight per day  (the amount between these two points depends on training status) and; Up to  1.8-2g per kilogram of bodyweight per day during periods of energy restriction  to prevent muscle loss – more than double the government recommendations. I think in general it would be better to m...

Installing R on Ubuntu 19.10

Download R Source code from https://cran.rstudio.com/index.html extract the .tar.gz file to a location gzip -dc R-x.y.z.tar.gz | tar -xf - current sources for the recommended packages, which can be obtained by rsync or downloaded from CRAN. To use rsync to install the appropriate sources for the recommended packages, run ./tools/rsync-recommended from the top-level directory of the R sources. Install necessary packages to add repository over HTTPS sudo apt install apt-transport-https software-properties-common Add CRAN external repository sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' edit /etc/apt/sources.list and remove comments for deb-src for line containing cran35/ (mostly last line of this file) execute sudo apt-get update to read the sources files. Install package dependencies using sudo apt-get...

My algorithmic Trading journey

Like many i used to manually watch and trade stocks, ETFs. Its non-productive and involves our emotions in trading decisions. So I wanted to automate trading. Initially used Trailing Stop and Limit orders. But they can automate only in a prescribed way. I started thinking about a way to trade programatically, where we have more control. My quest pointed to Zipline, a python algorithmic trading library. It support backtesting (testing algorithm with historic data) and most importantly supports live trading In this blog, I will walk you through my algorithmic trading journey. Zipline Installation From  https://www.zipline.io/index.html , I see it only supports python 2.7 or Python 3.5 Since python 2 was sun set on Jan 1 2020, there is no point in trying it. I went ahead with Python 3. For programming, installed latest Ubuntu 19.10 in a virtual machine . Ubuntu 19.10 comes bundled with Python 3.7.5. You can check your python version by typing python3  -V ...