<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Smiral Rashinkar on Medium]]></title>
        <description><![CDATA[Stories by Smiral Rashinkar on Medium]]></description>
        <link>https://medium.com/@smiraldr?source=rss-29a713429c20------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FkVwdQwtGmoSPeog8gzzaw.jpeg</url>
            <title>Stories by Smiral Rashinkar on Medium</title>
            <link>https://medium.com/@smiraldr?source=rss-29a713429c20------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 01:15:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@smiraldr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Vendor-agnostic Setup for Running ML & DL Experiments with GPU Support]]></title>
            <link>https://pub.towardsai.net/vendor-agnostic-setup-for-running-ml-dl-experiments-with-gpu-support-1a6ffa6f673d?source=rss-29a713429c20------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a6ffa6f673d</guid>
            <category><![CDATA[system-architecture]]></category>
            <category><![CDATA[nvidia-docker]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Smiral Rashinkar]]></dc:creator>
            <pubDate>Sat, 11 Jun 2022 01:50:54 GMT</pubDate>
            <atom:updated>2022-06-15T15:44:18.584Z</atom:updated>
            <content:encoded><![CDATA[<h3>Vendor-agnostic Setup for Running ML &amp; DL Experiments With GPU Support</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uZmMWkUyx7kRj89s" /><figcaption>Photo by <a href="https://unsplash.com/es/@twinckels?utm_source=medium&amp;utm_medium=referral">Tom Winckels</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>With many emerging solutions like AWS Sagemaker, Microsoft Azure Machine Learning Studio, Google Cloud AI Platform, etc, It can be overwhelming to choose a solution given the cost constraint and use case.</p><p>There are some pros and cons when it comes to using a cloud vendor solution:<br>Pros:<br>- A tightly integrated platform for data access, IAM, training, testing, and deploying ML &amp; DL workloads<br>- Solutions like AWS Sagemaker support multiple kernel configurations out-of-box which can be used to run the same notebook on different environment configurations<br>- Cloud support may come in handy to resolve issues with the platform<br>- One-click environment creation &amp; being managed service, these platforms usually have very few issues with infrastructure management</p><p>Cons:<br>- Pricing for such managed solutions can be higher than that of an Accelerated Hardware (GPU) VM.<br>- Solutions and pipelines created will mostly be vendor-dependent based on managed services or tools used. This introduces Vendor Lock-In, making it difficult to evaluate or move to a different vendor for cloud solutions.</p><h3><strong>THE VENDOR-AGNOSTIC SETUP</strong></h3><p>We can run multiple workloads using Docker Containers on the same machine with mounted volume which can help in rapid prototyping and experimentation. This Setup can be evolved by systemizing and integrating with various open-source solutions like Kubeflow, Flytelab for orchestration, MLFlow for Model Repository &amp; versioning, Horovod or Ray for Distributed training, etc.</p><p>Pros:<br>- Smaller workloads can share the same VM and its resources (including GPU).<br>- With mounted volume, the same files are accessible in all containers hosted on the same VM.<br>-Separation of concerns for ML &amp; DL Libraries, We can also use environment managers like venv or conda but usually managing packages within these environments can get messy. We can also customize each container’s python version without having any consequences on the base VM or other containers.<br>- One-time waiting period for pulling base images to the VM: Once all the dependencies are downloaded, Spawning up another container takes less than seconds in comparison to AWS Sagemaker instances which take ~2 mins for allocation of resources every time.<br>- Cost for a GPU Accelerated VM is typically less than that of managed platforms which may yield significant benefits in the longer run.<br>- No Vendor Lock-in: Freely move your workloads by pushing docker images to private registries and pulling them to VMs on different cloud vendors.</p><p>Cons:<br>- Data Scientists who are not savvy with infrastructure may prefer managed platforms over managing infrastructure for experimentation and deployments.<br>- Setting up alerts, service, and infrastructure monitoring takes extra effort which is a must-have for any production system.</p><h3>Steps to set up a vendor-agnostic setup:</h3><p>Step 1 :<br>According to the respective workload requirement, provision any Linux Based VM with resources as needed. For the example, we will assume that we want to set up a GPU accelerated experimentation platform. We will require a VM with a GPU provisioned, for eg G4 Series on AWS or NCasT4_v3-series or a GCP Compute engine with Nvidia t4 with 16 GB Memory, 4 vCPUs, and 125 GB Persistent Storage.</p><p>Step 2 :<br>Install and Update all the dev dependencies needed by the OS to function properly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e93240f8ffecf09e053b35a03c6f46aa/href">https://medium.com/media/e93240f8ffecf09e053b35a03c6f46aa/href</a></iframe><p>Step 3:<br>Installing the CUDA toolkit to access drivers to use the GPU efficiently<br>Please skip this step in case:<br>- VM doesn’t have an Nvidia GPU provisioned<br>- Base Image OS is custom and already has CUDA Support</p><p>Head over to <a href="https://developer.nvidia.com/cuda-downloads">https://developer.nvidia.com/cuda-downloads</a> and choose the appropriate options</p><figure><a href="https://developer.nvidia.com/cuda-downloads"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOb8j5RhAKel4EVVA2jsgw.png" /></a><figcaption>selecting the appropriate infra config to get commands to install CUDA drivers (source:<a href="https://developer.nvidia.com/cuda-downloads">https://developer.nvidia.com/cuda-downloads</a>)</figcaption></figure><p>For Advanced users, feel free to head into archives and change the CUDA version and install the same in case of any dependencies or specific use-cases. In case there are no preferences for the CUDA version, the above process should work fine.<br>Run the Nvidia-smi command to verify the proper install Cuda</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R31IslIpepgNleMB5ylvpw.png" /><figcaption>nvidia-smi output (source:author)</figcaption></figure><p>Troubleshooting CUDA Installation:<br>Make sure CUDA_HOME, and LD_LIBRARY_PATH are added to the path which will invoke the nvidia-smi command properly</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb7e880dc1569ae51c30c81143677ce8/href">https://medium.com/media/fb7e880dc1569ae51c30c81143677ce8/href</a></iframe><p>Installing Nvidia cuDNN (Optional):<br><a href="https://developer.nvidia.com/cudnn">NVIDIA cuDNN</a> is a GPU-accelerated library of primitives for deep neural networks. In case we require running deep learning and neural network-based workloads, it is recommended to have cuDNN installed on the base VM. <br>Head over to <a href="https://developer.nvidia.com/rdp/cudnn-download">https://developer.nvidia.com/rdp/cudnn-download</a> and accept the terms and conditions. Download the latest one in case there are no frozen requirements for the workloads.<br>Note: For installation of cuDNN follow the documentation: <a href="https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux-deb">Link</a><br>make sure to match the versions of CUDA and cuDNN package deb downloaded from the site while installing dependencies <br>8.x.x.x-1+cudaX.Y &lt;- 8.x.x.x-1 refers to cuDNN version downloaded and cudaX.Y refers to CUDA version installed previously. To confirm the Cuda version run the Nvidia-smi command. (Above version is 11.6)<br>Run the following command to ensure cuDNN is properly installed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJCY_Fx4dyt0-6BZujIHHQ.png" /><figcaption>verification of cuDNN installation (source:author)</figcaption></figure><p>Step 4:<br>Installing Docker and Docker-compose -</p><pre>#Docker installation<br>curl <a href="https://get.docker.com/">https://get.docker.com</a> | sh \<br>  &amp;&amp; sudo systemctl --now enable docker</pre><pre>#Docker-compose installation<br>cd /usr/local/bin &amp;&amp; sudo rm -rf docker-compose<br>sudo curl -L &quot;<a href="https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64">https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64</a>&quot; -o /usr/local/bin/docker-compose<br>sudo chmod +x docker-compose</pre><p>We can use docker-compose to set up multiple dependencies like mock DB for our training containers. This can come in handy while evaluating new solutions through rapid prototyping with docker-compose.</p><p>Installing Nvidia-Docker2 :<br>In the case of having GPU Accelerated workloads, we need the following configurations to be met by the system -<br>1. Docker Engine requires additional drivers to run workloads on GPUs.<br>2. Accelerated workload containers require Cuda drivers installed on containers to leverage GPU processing.</p><figure><a href="https://github.com/NVIDIA/nvidia-docker"><img alt="" src="https://cdn-images-1.medium.com/max/522/1*0Ugi8kcY0MMi3fCkLJdslA.png" /></a><figcaption>Nvidia-docker2 Usage (source:<a href="https://github.com/NVIDIA/nvidia-docker">https://github.com/NVIDIA/nvidia-docker</a>)</figcaption></figure><p>Run the following to install nvidia-docker2 on the VM instance.</p><pre>#adds the distribution to OS for installing drivers for docker<br>distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \<br>&amp;&amp; curl -s -L<a href="https://nvidia.github.io/nvidia-docker/gpgkey"> https://nvidia.github.io/nvidia-docker/gpgkey</a> | sudo apt-key add — \<br>&amp;&amp; curl -s -L<a href="https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list"> https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list</a> | sudo tee /etc/apt/sources.list.d/nvidia-docker.list</pre><pre>#Update and install nvidia-docker2<br>sudo apt-get update<br>sudo apt-get install -y nvidia-docker2</pre><pre>#restart docker engine to load new config<br>sudo systemctl restart docker</pre><p>We can verify the installation by the following command:</p><pre>sudo docker run -rm -gpus all nvidia/cuda:11.0-base nvidia-smi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DpVgxLIG3kJhC_CiXJQewQ.png" /><figcaption>verification of Nvidia-Docker2 installation (source: author)</figcaption></figure><p>With this, we have completed the basic setup required to run and manage GPU Workloads on platform-agnostic VMs.</p><h3>Creation of custom docker images as per requirements:</h3><p>As noted above, if we want to run GPU Accelerated workloads the container must have a Cuda toolkit and drivers to communicate with the GPU.</p><p>This can be achieved by getting a base image for the docker build which already has Cuda drivers preinstalled which we can further customize by installing packages for python and OS. To learn more about using containers for Data Science workloads check out the blog: <a href="https://blog.devgenius.io/breaking-down-docker-for-data-science-6fabb752b087">Link</a>.</p><p>Note: For running containerized workloads that use GPUs on VM for acceleration, the docker run command would look like</p><pre># Here — gpus all specify that all GPUs available are to be used for # accelerating workload<br>sudo docker run — gpus all tensorflow/tensorflow:latest-gpu-jupyter</pre><h3>So now we have the basic setup, where are we headed to?</h3><p>Now that you’re able to run platform-agnostic accelerated workloads only using a VM inside the docker containers, it can finally evolve into more opinionated systems based on customized requirements and use cases. Remember that these can again be integrated with managed open-source offerings or even with cloud-specific tools if needed.</p><p>For Example (See fig1), Containers can access data residing in any structured or unstructured DB through private VPC enabled for the VM or Kubernetes cluster network. We could have a single VM with GPU acceleration to run multiple smaller workloads or a powerful multi-GPU instance running distributed training on a large amount of data. These can then be integrated with MLFlow for storing, and managing ML artifacts and its training and evaluation metrics. We can further configure the artifact store to be an s3 bucket, azure blob storage or a GCP bucket based on the cloud environment preferred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ybv_WP2kXwAzzdsCIJVRmQ.png" /><figcaption>Fig1- Platform agnostic ML training system (Source: author)</figcaption></figure><p>Moving further (see Fig2) after the deployment of the model, using MLOps solutions like whylogs, nannyml, etc we can trigger the kubeflow pipeline based on model inference metrics depreciation, and drift metrics. The pipeline can be configured to spawn a spot instance pod (cheaper than an on-demand instance pod) on Kubernetes which can then be used to repeat the training process with new or modified data in the same environment on a Ray cluster for distributed training. After the training completion, resources are freed which can help reduce costs in the longer run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvYd_bK8i-xlrPvX20hxrA.png" /><figcaption>Fig2- Platform agnostic ML training pipeline (Source: author)</figcaption></figure><p>All these systems need a one-time setup effort. Configuring monitoring and custom alerts are also needed to improve the transparency of pipelines.</p><h3>Sum and Substance</h3><p>ML Architects will have to evaluate the situation for the typical “build vs buy” scenario. If we are planning to run smaller experiments for less period on a short-term basis, buying and using the managed services would provide a better ROI as building a custom platform has to be justified for its efforts. In the case of running larger and longer experiments on a long-term basis where customized solutions are required; after a cost and effort analysis, building a platform might be more suitable for training, deploying, monitoring, and maintaining ML Models in production for an extended period.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a6ffa6f673d" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/vendor-agnostic-setup-for-running-ml-dl-experiments-with-gpu-support-1a6ffa6f673d">Vendor-agnostic Setup for Running ML &amp; DL Experiments with GPU Support</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking down docker for data science]]></title>
            <link>https://blog.devgenius.io/breaking-down-docker-for-data-science-6fabb752b087?source=rss-29a713429c20------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fabb752b087</guid>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Smiral Rashinkar]]></dc:creator>
            <pubDate>Mon, 10 Jan 2022 18:43:59 GMT</pubDate>
            <atom:updated>2022-06-05T18:42:31.232Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever set up a database or any open-source tool like apache Kafka manually on VM? Setting up infra for experimentation or say even for production is quite a fuss, Moreover replicating the whole environment is even more difficult.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*e8u6teTHyalPejIBauj4Jw.png" /><figcaption>source: <a href="https://www.docker.com/sites/default/files/d8/2019-07/Moby-logo.png">Image</a></figcaption></figure><h4>So what the heck is “DOCKER”?</h4><p>According to the official definition — “Docker is a set of the platform as service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.”</p><p>Now let’s try to understand this in simpler logic.</p><p>Say you have a laptop where you have manually installed python 3.8 with a couple of libraries in a virtual environment with a postgresql running on your local. Now you feel that you need the exact same setup in five different cloud VMs , replicating the whole environment can be tedious in this case.</p><p>The best case to still be doing it manually can be setting up shell scripts that automate the whole process but what if your laptop has windows as the OS and the target vms have different distros of Linux like CentOS, Ubuntu etc. In some cases you might find these scripts behave differently even due to the build of the OS.</p><p>What about creating a VM on your local device? Sure this is where virtualization comes in. In simpler terms, you could now have a different OS running on the same laptop at the same time and their resources would be shared. A VM has a fully feature-packed distribution of OS and everything works as expected.</p><p>Great ! or not so Great??</p><p>The question here is: Do you need all those features? An OS itself has a huge size due to its features. This can be further optimized.</p><p>So, think of Docker as an Engine that runs an encapsulated environment or rather a VM with minimalistic features that you have specifically mentioned and with just enough of the operating system for it to function as expected. Containers are nothing but these optimized environments which run in isolation which share resources from the host machine. You can further enable networking using ports that enable containers to communicate with local network , vpc or public networks. You can also mount your local or any persistent storage to one of these docker containers to persist the changes when you stop the docker container.</p><h3>Why should I use Docker for Data Science?</h3><p>If you’ve been experimenting with data science packages on your local machine with package managers like pip and conda , messing around with virtual environments to resolve package dependencies or having issues in replicating your results due to environmental changes. Sometimes in the name of an experiment we go berserk on our local environment and we may by mistake break some dependencies and even our GPU driver configs , Docker can solve all these problems for you.</p><h4>How so?</h4><p>You can run a whole juypter environment (with or without conda environment). Plus you can get GPU support with minimal setup. There are many docker images that support GPU as they have proper versions of drivers required for efficient usage. For Example :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a07779f744dac5e85161bf70dfe20ae/href">https://medium.com/media/1a07779f744dac5e85161bf70dfe20ae/href</a></iframe><p>You can find many official organisations like <a href="https://hub.docker.com/r/tensorflow/tensorflow">tensorflow</a> and <a href="https://hub.docker.com/r/pytorch/pytorch/tags">pytorch</a> hosting their official images publically for use. You may need to read the info on the overview page to decide the right image tag for your use case but these are usually self explanatory. For the example, above we have used jupyter with tensorflow already configured but if you prefer installing everything yourself and just require the base env you could try <a href="https://hub.docker.com/r/conda/miniconda3/">miniconda</a> or plain ol’ <a href="https://hub.docker.com/r/jupyter/base-notebook">jupyter</a> nb.</p><p>You can either have your notebooks and requirements.txt copied to the docker container or you could mount the volume (basically just attach your local storage to docker container) in case your files are too large due to which docker image build size may be heavily affected. In other words, your files won’t be packed inside the container and in case you need to share the setup with anyone you’ll also have to share the files separately along with the container.</p><p>You can run an example by doing the following:</p><pre>git clone <a href="https://github.com/smiraldr/docker-jupyter-sample.git">https://github.com/smiraldr/docker-jupyter-sample.git</a></pre><pre>cd docker-jupyter-sample/app</pre><pre>docker build -t my_tf_jupyterenv .</pre><pre>docker run -v /Users/smiralrashinkar/Desktop/free/docker-jupyter-sample/app/notebooks:/app -p 80:80 my_tf_jupyterenv:latest <br>#after -v remove the path and paste your own path</pre><p>You can then head over to your localhost:80 and Voilà ! you have your jupyter lab running inside this container. Moreover you can see your notebooks on jupyterlab as we have mounted a volume from our local machine.</p><p>Now if you want to share this environment or deploy it on cloud you can simply push the container to dockerhub or deploy it using various solutions like Google cloud run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Yaghxdz-eA6Acuoe2wgNkQ.gif" /><figcaption>Docker + Data Science = ❤️ | source : <a href="https://dribbble.com/shots/3122897-Nyan-Whale">Image</a> (permitted for use by author)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fabb752b087" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/breaking-down-docker-for-data-science-6fabb752b087">Breaking down docker for data science</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying on StackOS — AWS of web3]]></title>
            <link>https://smiraldr.medium.com/deploying-on-stackos-aws-of-web3-83f9171d0071?source=rss-29a713429c20------2</link>
            <guid isPermaLink="false">https://medium.com/p/83f9171d0071</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[stackos]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Smiral Rashinkar]]></dc:creator>
            <pubDate>Mon, 10 Jan 2022 18:42:39 GMT</pubDate>
            <atom:updated>2022-01-10T18:42:39.668Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying on StackOS — AWS of web3</h3><p>Ever deployed any application on cloud using docker containers? Pretty simple right? Be it frontend , backend or any service , if you’ve dockerised it and deployed it ever on kubernetes- You know its convenient and simple.</p><h4>What if we could deploy the same applications on web3 ?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*9zRB2X1xA2WzHbJFlPEvgg@2x.png" /></figure><p>With StackOS you can ! Here’s how :</p><p>Prerequisites —</p><ul><li>Metamask Wallet with Matic tokens(If you want your application deployed on Polygon chain) or BNB tokens (If you want your application deployed on BSC mainnet chain)</li><li>Dockerized application for deployment on docker hub or any image registry</li></ul><p>Head over to <a href="https://www.home.stackos.io/">StackOS</a> site.</p><ol><li>Get some stack tokens from <a href="https://www.home.stackos.io/token-holders">here</a>.</li><li>Go to <a href="https://app.stackos.io/">https://app.stackos.io/</a> to deploy your application</li><li>Choose from the following :</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pULHnhcvxpuUWLbyIChFoA.png" /><figcaption>Select Network and Cluster type as per requirements (note that hpc costs vary from standard)</figcaption></figure><p>4. Login to the site with metamask and you’ll be directed to the dashboard</p><p>5. Before deploying applications you must know the amount of resources to allocate for its consumption. Then move to the upgrade tab and allocate resources or choose prefined standards according to your applications to get an estimate of pricing for your deployments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fB6vXk_TYnjq7UZkT1i8FQ.gif" /><figcaption>Allocating resources and getting an estimated monthly cost</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qk5WtdJiZmKEJYmBeRs_Hw.png" /><figcaption>Predefined allocation of resources for applications</figcaption></figure><p>6. After clicking on upgrade and approving matic and stack tokens you’ll be allocated resources on dashboard (Please wait till all transactions have completed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yq15mze52L1jjkJ7q1VH6A.png" /><figcaption>Check the strip for allocation and limits of resources after success</figcaption></figure><p>7. We can click on create new application to deploy our dockerised application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1odhiSbSnaRFyjLEe145Q.png" /><figcaption>Enter various configs and information related to image which has to be deployed</figcaption></figure><p>8. Enter the following :<br> Application Name- Name of your application (Changes your hosting url according to application name)<br>Image Name- Enter the Image name hosted on docker registry and in case of private image toggle and provide credentials for accessing the image<br>Protocol , Container port and Service Access port- Choose the respective parameters according to your container<br>Host URL- This will be where you can access your application on web3<br>Check other parameters and options according to requirements.</p><p>9. Choose the resources required for current application (by allocating less resources you can run more applications if you have more resources). Before deployment take into consideration about the size of dockerised application and the resources it consumes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHpyQYrzB0dqlDuaPhiheA.png" /><figcaption>choose the properties as required</figcaption></figure><p>10. Further we can also choose to whitelist specific ip addresses if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qW64ORqALMPPowK7eGUndg.png" /><figcaption>note that 0.0.0.0/0 whitelists all addresses for application access</figcaption></figure><p>11. After the application is deployed , you’ll finally be able to see your application on the given External DNS url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TO37LXduwfZkyR-5RBEoRg.png" /><figcaption>resources have been completely allocated for the application and it works on the external dns url</figcaption></figure><h3>And now your application lives on web3 !</h3><p>Finally after use you can withdraw your tokens and settle your account from the upgrade tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*0jtwyMeJ7EI9M-g4sCFyUQ.gif" /><figcaption>Web 3.0 — The Future is here 🌟</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83f9171d0071" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Similar Patent Recommendations for Chemistry Patents]]></title>
            <link>https://medium.com/ireadrx/building-similar-patent-recommendations-for-chemistry-patents-c68932c05796?source=rss-29a713429c20------2</link>
            <guid isPermaLink="false">https://medium.com/p/c68932c05796</guid>
            <category><![CDATA[life-sciences]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[patents]]></category>
            <category><![CDATA[similarity-search]]></category>
            <dc:creator><![CDATA[Smiral Rashinkar]]></dc:creator>
            <pubDate>Wed, 30 Jun 2021 09:15:42 GMT</pubDate>
            <atom:updated>2021-09-20T12:21:00.592Z</atom:updated>
            <content:encoded><![CDATA[<p>Product search serves as a very important and probably the most used feature for a great product. Also, while solutions like Elasticsearch, Solr, PostgreSQL(full-text search plugin) exist, which provide full-text search and string matching with keywords and parts of strings, they are sometimes not enough to match the user with very closely related results. We can make use of vector embeddings to get semantically close results for user searches.</p><p>In patent research, this can be extremely useful to provide useful results, leading to new discoveries and reduced effort in research. We can use NLP to power our search intelligence and create similar patent results with the results already appearing.</p><p>For example, suppose a user searches for hydrocarbons. In that case, they will definitely get results where the text contains the string “hydrocarbons.” Still, with NLP to power the search, we can get similar patents that discuss actual hydrocarbons like methane, ethane, etc.</p><p><strong>How can we provide semantically similar and related results based on the data available?</strong></p><p>We found vector search to work really great for finding similar patents with the data available from the many experiments we conducted.</p><p>Here is one way which worked really great for us with all the challenges we faced:</p><p>We used Universal Sentence Encoder to convert text to vector embeddings and use these vectors to perform a similarity search by getting a similarity distance from comparing two vectors.</p><p>Here are some issues with this approach:<br>• Now that we have decided to use Universal Sentence Encoder to create vector embeddings, how do we preprocess patent data before encoding it? Although you could technically feed the whole text to Universal Sentence Encoder, this dilutes the meaning and variation that can be captured from the text and converted to embedding, which would yield not-so-relevant results.<br>• Calculation for these similarity distances on the whole dataset can be costly and time-consuming, especially when the dataset contains around 3M patents.<br>• Choosing the data for preprocessing is a significant factor as well; we had the title, abstract, and claims text as options</p><h3>Solution?</h3><p>Firstly, we need to choose which text can be used for embeddings. While claims texts can be really great for similarity search, they are long. Moreover, they might require extractive or abstractive summarization, which is a different problem statement altogether, but using claim text is definitely an option for v2.0 of similarity search.</p><p>We decided to use title and abstract for embeddings with some preprocessing to reduce the length and capture important tokens from the text using biomedical and custom chemistry Named Entity Recognition (NER) models.</p><p>Second, preprocessing title and abstract by removing stop words and excluding words with lengths greater than the threshold value of 15 and less than 4. These words are further lemmatized and tokenized for the USE embedding process.</p><p>Creation of embeddings takes considerable time even while using GPU with Universal Sentence Encoder. Nevertheless, as noted, calculating similarity distance and nearest neighbors (similar patents) between a single patent text with the whole dataset takes about ~2 mins, which would be very prohibitive.</p><p>We can solve this problem by using Approximate Nearest Neighbours instead of actual nearest neighbors. For some loss of accuracy, we get a considerable speed boost. While there are some great libraries like faiss, nmslib, etc., we decided to use <a href="https://github.com/spotify/annoy">Annoy</a> as our ANN Library, which uses tree-based implementation for the creation of ANN Index, plus it also has other awesome features like build on disk, which lets you build indexes for large datasets which might be greater than your RAM size.</p><p>Using Annoy Index, we can get the top nearest semantic matches for patent text. It also provides us with the similarity distance, which provides a measure of similarity between patents, i.e., the lower the distance, the higher the similarity.</p><h3>Scope for Improvement and Final Results:</h3><p>With external SME validations, we found the title text embeddings to yield better results than abstract text. As mentioned, with appropriate preprocessing, claims text can also be used to evaluate this feature.</p><p>Using Universal Sentence Encoder can be considered as a good baseline. Still, we can use models like BioSentVec for encoding as it has been trained on PubMed+MIMIC-III, which can provide better semantic embeddings in biomedical texts and yield better results.</p><p>While the Annoy Index was primarily used for precalculating of top similar patents from existing datasets, it can also serve as an intelligent search for unseen search queries for matching with existing patents (Unless new patent data is ingested)</p><p>This is live at <a href="http://ichemist.ai/">http://ichemist.ireadrx.ai/</a>, so head over to our app and try searching for patent keywords and check out the top 5 similar patents related to the original patent!</p><p>(if the above link is broken check out our demo videos at <a href="https://www.youtube.com/playlist?list=PLZ0CqxpJ8nQsPeIg5QowE1s5esIONoFQt">https://www.youtube.com/playlist?list=PLZ0CqxpJ8nQsPeIg5QowE1s5esIONoFQt</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*haa_HPEEmvaOuja9SohUkw.png" /><figcaption>Click on the “Show Similar Patents” to retrieve closely related patents</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*mRvS1hyEbbzzz0pwaJRKjA.png" /><figcaption>Top 5 patents related to the original patent</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c68932c05796" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ireadrx/building-similar-patent-recommendations-for-chemistry-patents-c68932c05796">Building Similar Patent Recommendations for Chemistry Patents</a> was originally published in <a href="https://medium.com/ireadrx">iReadRx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Topic Models for Organic Chemistry Patents]]></title>
            <link>https://medium.com/ireadrx/building-topic-models-for-organic-chemistry-patents-1610630bd2aa?source=rss-29a713429c20------2</link>
            <guid isPermaLink="false">https://medium.com/p/1610630bd2aa</guid>
            <category><![CDATA[patents]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[biomedical-engineering]]></category>
            <category><![CDATA[gensim]]></category>
            <dc:creator><![CDATA[Smiral Rashinkar]]></dc:creator>
            <pubDate>Mon, 21 Jun 2021 04:28:07 GMT</pubDate>
            <atom:updated>2021-06-21T04:28:07.088Z</atom:updated>
            <content:encoded><![CDATA[<p>Working with biomedical patents for research and discovery consumes a lot time and we can improve this process by fast-tracking it with some methods using AI.</p><p>What if researchers can explore a patent and get a general idea summarized or subject related to the patent? Topic modeling in NLP does exactly that for any text. We can achieve it using algorithms like Latent Dirichlet Allocation which can be implemented using state-of-the-art (SOTA) NLP Libraries like gensim, but working with biomedical texts can be tricky.</p><p>Before creating topic models we need to answer the following questions;<br>1. How do we preprocess the data we have for patents?<br>2. We will user title, abstract, and other patent attributes as inputs. Which attributes can be used to create topic models?<br>3. What are the optimal number of topics that exist and can be identified from the data available?</p><p>Lets us look into the process step by step.</p><h3><strong>Preprocessing</strong></h3><p>We preprocessed both title and abstract text :<br>• removing the stop words<br>• creation of bigrams using various models from scispacy (this ensures better results as scispacy pre-trained models are trained on biomedical datasets)<br>• lemmatizing the data <br>• tokenization</p><p>After preprocessing and using the text we finally settled to use both title and abstract for topic modeling.</p><p>Note: Abstract data was not available for some patents for which title data has only been considered.</p><p>After this, we create an id2word i.e. a dictionary for mapping id and tokens, and create a corpus from our processed data to get term-document frequency by using doc2bow.</p><h3><strong>Topic Modelling</strong></h3><p>We have used Latent Dirichlet Allocation as our topic modeling algorithm and while we experimented with many packages, Gensim is really a great all-purpose NLP Library that can be used for LDA.</p><p>Coming to Topic modeling we need to know the number of topics that exist in our data. Also, we need to consider which data is to be used for topic modeling, title or abstract, or a combination of both.</p><p><strong><em>Deciding the number of topics:</em></strong><em><br></em>•Coherence Score - This score measures the relative distances between words within a topic<br>•Jaccard Score - Jaccard similarity score can be used to compare the similarities for top words in different topics. The goal is low Jaccard scores for coverage of the diverse elements.<br>•Hierarchical Dirichlet process (HDP) - HDP is an extension of LDA, designed to address the case where the number of mixture components (the number of “topics” in document-modeling terms) is not known apriori but is difficult to implement and didn’t work well in our case.</p><p>Now the LDA models implementations were straight out gensim library for starters but after some experiments, we found about the MALLET Topic model package which could be used with gensim’s mallet wrapper and provided us with better coherence scores and results.</p><p>Coherence Score &amp; Jaccard Score:<br>For calculation and comparisons of these scores, models have to be trained for a finite number of topics and we chose to start from 4–13 topics and found the following results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*kVDdfWLG2q76NGIPuevSCg.png" /><figcaption>Coherence Score</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XnkPEmBgrBZF719X0WvKwA.png" /><figcaption>Jaccard Score Implementation yielding 7 as the ideal number for existing topics</figcaption></figure><p>But after several more experiments and External SME validations, we settled for 6 as the number of distinct existing topics with topic assignment through combined score and normalization of results from the title and abstract text.</p><h3><strong>Visualizing Topic Models</strong></h3><p><strong><em>Using Word Cloud:</em></strong><br>Word Clouds can help visualize top words in a topic for further analysis and identifying the actual subject.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHaeJLAPrGfY-LV3Ey--Ew.png" /><figcaption>Output for 7 topics using word clouds</figcaption></figure><p>Although word clouds are great for visualizing and understanding a topic model there is a better way to get a deep understanding.</p><p><strong><em>Using pyLDAvis Library:</em></strong></p><p>pyLDAvis is an interactive LDA visualization package that provides an interface with some control parameters to play around with and analyze the topic model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*XQNiNlY4pnu2TEJveT6Uqg.png" /><figcaption>Output using pyLDAvis for a topic model with 6 topics</figcaption></figure><p>Here we can select any of the topics to look at the top words that belong to that topic which appear on the right panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WV0rRWkypMlzPcaecObUw.png" /><figcaption>Top words belonging to 4th topic</figcaption></figure><p>On the top right side, we also have a relevance metric slider which can be adjusted to get top words among the topics which may be belonging to other topics as well or to get topic-specific words that are unique for the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPiqLzS9xJYRsaq9yuYhyw.png" /><figcaption>Words specific to the 4th topic which do not appear in other topics when the relevance metric is slid to 0</figcaption></figure><p>This is great for exploratory topic analysis but according to some sources and our experiments, 0.6 is an optimal level for relevance metric for topic analysis.</p><p>Also by hovering over words on the right panel we can check if it belongs to multiple topics and their distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfE0maYYrbk13J8HIb-g9A.png" /><figcaption>Word “method” being hovered over and visualizing that it belongs to various topics</figcaption></figure><h3>Final results and outputs</h3><p>After getting the topics validated and named through SME validations, we can finally use this topic model to classify and categorize patents using their titles and abstracts.</p><p>Topics can be pre-computed for existing patents. We also created an API to serve this model where the input could be the title or abstract text and output would be the top 3 topics it relates to.</p><p>Also, we have this live at <a href="http://ichemist.ai/">http://ichemist.ai/</a> so go ahead and search for keywords or patents and get highly relevant results with the top 3 topics they belong to!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*o2An8AXhS0FtWYr8N_cgTw.png" /><figcaption>Patent with top 3 topics</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1610630bd2aa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ireadrx/building-topic-models-for-organic-chemistry-patents-1610630bd2aa">Building Topic Models for Organic Chemistry Patents</a> was originally published in <a href="https://medium.com/ireadrx">iReadRx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning With Google]]></title>
            <link>https://medium.com/dsc-srm/learning-with-google-faf54fb9af06?source=rss-29a713429c20------2</link>
            <guid isPermaLink="false">https://medium.com/p/faf54fb9af06</guid>
            <category><![CDATA[qwiklabs]]></category>
            <category><![CDATA[learn]]></category>
            <category><![CDATA[colab]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Smiral Rashinkar]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 06:02:56 GMT</pubDate>
            <atom:updated>2019-09-08T07:47:25.589Z</atom:updated>
            <content:encoded><![CDATA[<p>Google is one of the top-notch companies that offer Free Learning tools For Students or Even for all People Irrespective of Age and Occupation. Simply put- One needs only a good Internet connection and a device to connect and BOOM Ready to LEARN!</p><p>Google Offers Many Such Software and Tools which can be used for learning .For Example Google Analytics which is a free tool for Digital Marketing.</p><p>Do Check Out the Following Links too:</p><p><a href="https://edu.google.com/?modal_active=none">Solutions built for teachers and students | Google for Education</a></p><p>Also they offer free tier for tools like Firebase and Google Cloud Platform for Evaluation and Learning Purposes.</p><p>Here I would Love to Highlight two such tools I found very Useful and which helped to develop my interests.</p><p>As A Data Science Enthusiast like every other member of the community i feel Google Colab is No less than a Boon from Google as After Jupyter it has been my Learning and Evaluation tool for Data Science.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*mzFCZXgpKkUvYirVkqDFyw.png" /></figure><p>While Some Prefer Edge Execution of Workloads when a GPU is not Necessary ,I would Prefer all my Execution on this platform as there is no hassle of setting things up and it is as simple as executing a Pip Install with ! (For Terminal Commands) for any packages hosted on PyPI. It is Pretty Simple and Straight-forward.Not to mention it provides free GPU for your deep learning workloads ! Since many people don’t have very powerful hardware, Colab can be one of the best tools for them to experiment with their workloads for free.This tool also provides simplified GUI to Upload and Download your Data.</p><p>BONUS HACK !! :<br>You Can Also Mount your Google Drive to access it directly like a local environment on Google Colab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*fDsLxFZv_yoHc3k6_QR4vA.png" /></figure><p>While I love Colab there are some changes which differ to vanilla distribution of Jupyter notebooks.If you prefer the original Jupyter shortcuts and usage ,do check out Kaggle Kernels as they are very similar to Jupyter with a different flavor of UI and of course a free GPU.</p><p>Another Tool which helps me Gain and Widen my Knowledge on Cloud Computing and DevOps is Qwiklabs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*sApb3ImdAPxMhW2Zd8iRAg.png" /></figure><p>Qwiklabs Is gives you temporary credentials to Google Cloud Platform and Amazon Web Services, so you can learn the cloud using the real thing — no simulations. From 30-minute individual labs to multi-day courses, from introductory level to expert, instructor-led or self-paced, with topics like machine learning, security, infrastructure, app dev, and more ! They have it.</p><p>I Started with Qwiklabs when i Enrolled in Coursera’s Architecting with Google Cloud Platform Specialisation. You can check it out here : <a href="https://www.coursera.org/specializations/gcp-architecture">https://www.coursera.org/specializations/gcp-architecture</a></p><p>Qwiklabs provides a simple interface for user to generate credentials and use GCP for experimenting without any Consequences! BUT the credentials last till the timer in Qwiklabs hit zero. Considering the task they give ample time for one to complete tasks.</p><p>It has step wise instructions which the user can read along and execute by understanding. They conduct weekly Speedruns where there are about 4–5 labs based on a domain like kubernetes and the user needs to complete all of the labs as fast as possible. As this is a Global event, you get to participate with people from different countries.Sometimes Qwiklabs conducts speedruns with live twitch streams for beginners. The Winner and top runner-ups are eligible for Goodies !</p><p>As a Matter of Fact I won the BigQuery Speedrun. I was Awarded $25 Starbucks Gift Card and $25 worth Qwiklabs credit to continue Further with my progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SGe9w7-Q9RtuuVZTEzhANA.png" /></figure><p>I Also had the privilege to share same at Google Next Extended’19 Chennai:</p><p><a href="https://www.linkedin.com/posts/smiral-rashinkar_googlecloud-qwiklabs-gcp-activity-6538032794013134848-43WR">Smiral Rashinkar on LinkedIn: &quot;Shared My Experience and Achievements about Qwiklabs at Google Next Extended &#39;19 event organised By Google Cloud Developer Community Chennai. Thanks for this Opportunity Manikandan Krishnamurthy. #googlecloud #qwiklabs #gcp #speedrun #nextextended19 #googlenext19 #googlenext19chennai&quot;</a></p><p>BONUS HACK !! :</p><p>Keep an eye on Qwiklabs LinkedIn Page as they regularly share free subscription codes.</p><p><a href="https://www.linkedin.com/company/qwiklabs-inc-/">https://www.linkedin.com/company/qwiklabs-inc-/</a></p><p>Looking Forward to Learn more with Google !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faf54fb9af06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dsc-srm/learning-with-google-faf54fb9af06">Learning With Google</a> was originally published in <a href="https://medium.com/dsc-srm">DSC SRM — powered by Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>