"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

October 15, 2023

CNN Learning One pagers

Product and Example

  • https://tangoeye.ai/
  • Retail solutions built on
  • Age Detection Models
  • Gender Detection Models
  • Face Detection
  • Re-identification

Models for Training - tensorflow hub

How CNN works - Visualizer

How Features are Learned - 10 class classification

  • Step 1: Take a batch of training data and perform forward propagation to compute the loss.
  • Step 2: Backpropagate the loss to get the gradient of the loss with respect to each weight.
  • Step 3: Use the gradients to update the weights of the network.
Backprop summary
  • Chain rule derivate
  • The procedure repeatedly adjusts the weights of the connections in the network so as to minimize a measure of the difference between actual output and desired output
  • Ability to create new distinguishing features
  • The aim is to find the set of weights that ensure that for each input vector the output vector produced by the network is same as the desired output vector
  • The drawback in learning procedure is that the error surface may contain local minima so that gradient descent is not guaranteed to find a global minimum
Activation Functions
  • Introduce non-linearity into a model
  • We need non-linearity, to capture more complex features and model more complex variations that simple linear models can not capture.
  • neural networks use non-linear activation functions, which can help the network learn complex data, compute and learn
  • Signmoid, Tanh, Relu
Designing CNN
  • The first rule of thumb is that you should not try to design your own architecture from scratch
  • If you are working on generic problem, it never hurts to start with ResNet-50. If you are building a mobile-based visual application where there is limited computation resources, try MobileNets

Keep Learning!!!

October 12, 2023

Forecasting Setup MVP to Large Scale Deployment

Phase I (Initial use cases)

  • DVC - Data Versioning and Control
  • Databases - Sales / Historical data
  • External Marketing Campaign data 
  • Feature Engineering - Database / Feature Store
  • Model Building - ML / DL Algos
  • Model Experiment Tracking - MLflow
  • Drift / Monitoring - Evidently AI
  • Model Deployment - API / Serverless function
  • Actuals Tracking Loading - Database
  • Model Scheduling / ETL Scheduling - Jobs based on AWS / GCP / Custom scheduler cron jobs
  • I prefer dockerizing it and deploy it in GCP APP engine like a Nocode / Low code approach for the first few models
  • Custom Reporting for trends/patterns making it more accessible/relatable to business
  • Reporting for Past - Present - Future. Making predictions relatable
  • Explainable AI to compare predictions vs actuals to interpret cause - -reason in a more Non-ML Approach

Phase II (Serving large models > 30)

  • Kubernetes based Platform
  • Once the platform is deployed you can leverage out of box images / notebook / pipeline / monitoring options available
  • Kubeflow Pipelines

Kubernetes as a Service: GKE vs. AKS vs. EKS

Build a Pipeline

Keep Exploring!!!

October 11, 2023

Chatbot Lessons

Interesting Read

GenAI Customer Care Project Now Saving $4M/yr for Car Insurance Firm, Jerry

Key Lessons

  • Leverage Large Language Models (LLMs) to create a chatbot 
  • Open AI GPT-4 for complex queries
  • Open AI GPT-3.5 for initial sorting
  • Dataset - Messages are captured from chat and SMS through Twilio and stored on Jerry's servers
  • Routing Agent - Route based on requests - "Payments," "Policy," and "Opt-out" agents
  • Webhook / API - Handlebars to insert data from their database into the chatbot's responses

Key Learning's

  • Prompt engineering
  • Rapid iteration
  • Investment in testing
  • Version control

Drawback of LLM
  • Exposes your corporate data to the provider of your LLM 
  • LLMs have been shown to suffer from “hallucinations
Quick Lessons
  • FAQ from Cache
  • VectorDB for queries where answers can be located in docs
  • Intent recognition and call APIs based on OrderNumber#
  • Knowledge Graph if we have some meta data loaded
  • If all attempt fails LLM answer
  • Add guard rails wherever possible

Ref - Link

Dialogflow Notes Link



Keep Exploring!!!!

Vision Latest Notes - Text-to-Image Generation

Vision Latest Notes - Text-to-Image Generation

Alignment in Text-to-Image Generation

Key components

  • Controllable Generation
  • Editing
  • Better following prompts
  • Customization

Techniques

  • GAN
  • Auto-Regressive
  • Diffusion
  • Non AR Transformer

One Liners

  • GAN - Learn to Fake it until it becomes Real
  • AR - Image to patches, Patches mapped to indexes - Tokens, Prediction - Set of tokens one by one
  • Non-AR Transformer - Schedule policy to generate tokens at Each step
  • Diffusion - Random noise in each step, Subtract noise to end up with the required semantic quality

Diffusion Overview




GLIDE

DALL-E-2



Image Super-Resolution via Iterative Refinement

Keep Exploring!!!

Evaluating LLM Models

Good checklist on Evaluating LLM Models

  • LLM Type - Open source / Proprietary / Datasets
  • Deployment Options - Private cloud or API model
  • Infra needs - Self-hosting
  • Retrieval Augmentation - Support for RAG
  • Scalability - Performance of large RAG datasets
  • Hallucinations - Handling Hallucinations
  • Benchmark compared to other competitive models
  • Legal Compliance - IP / ownership of prompts / PII 
  • Output Compliance - Bias / Toxicity
  • Output filtering / Content filters

Keep Exploring!!!

Sales Forecast - Exogenous vs Endogenous Variables

Sometimes jargon occupies too much of concepts, Being able to explain it in business terms is key to being able to relate to it. 

Now we have data drift, and model drift. 13 years ago when we implemented forecast when the actual and prediction varied we ask the store manager 

  • Reason for it
  • Does actual data make sense for future training or use forecasted data

Terms Exogenous / Endogenous can be put in more business-friendly Terms :)

Exogenous - External cause

1. Market Trends: This refers to the overall direction in which the market that the product or service is operating in is headed. It includes factors such as consumer behavior, buying trends, or preferences which can affect the sales forecast significantly.

2. Economic Conditions: This includes factors like inflation rates, unemployment rates, gross domestic product (GDP), etc. These conditions can influence consumer spending and thus directly affect the sales forecast.

3. Competition: The actions (like pricing strategies, marketing campaigns, product launches) of competitors in the market can also significantly impact the sales of a product or service. Hence, this is an important exogenous variable in sales forecast.

Endogenous - Internal cause

1. Past Sales Data: The historical sales performance is a key factor in predicting future sales. Based on historical data, businesses can form patterns and trends that help in forecasting future sales.

2. Pricing: The price of a product or service plays a crucial role in determining its demand. Changes in price, due to factors like discounts, offers, etc., can significantly influence sales.

3. Advertising and Promotions: The level of advertising and promotional activities can impact the demand of a product or service. Businesses can increase sales by intensifying their marketing efforts. Therefore, the effectiveness of advertising and promotional activities is directly related to the sales forecast.

Keep Exploring!!!

October 09, 2023

NLP Summit Key Talks Slides

NLP Summit Key Talks Slides

Patient Similarity through Representation Learning from Medical Records

1 - Problem Statement

2 - Data Sources and Challenges


3 - Multiple levels of Data Collection over extended periods

4 - Data Pipeline


5 - Representation

6 - Patient Similarity

7 - Classification

Operationalizing NLP Models

Model Development

Model Dev Cycle

Implementation Monitoring

MLOps Cycle

Suicide Classification for News Media using NLP

Suicide Stats

Topic Classification

Suicide Classification

Automated Extraction of Medical Risk Factors for Life Insurance Underwriting

Health Trends

Pipeline

Models

Functional Flow

How to Build a Question Answering Application with Haystack in 30 Minutes

5 - 1 Flow

5 -2 Pipelines

Keep Exploring!!!

October 06, 2023

Retail API Google

Retail API Google

Low code / No code approach. 

High live Customer Journey

1 - Data Sources

The key effort is integrating the different data sources/customer data.



2 - Model Selection

Model - Objective - Finetuning

Legacy Solutions

Discovery AI overview


Keep Exploring!!!

October 05, 2023

GCP DialogFlow Notes

Create a Generative Chat App with Vertex AI Conversation

Key References


Data Store Setup
Data Store Setup

Webhooks API endpoints


Keep Exploring!!!


October 01, 2023

Google Dialogflow Notes

Pointers / References

  • Intent - Entity mapping / Options
  • Intent - Supplied from Traning Text 
  • Entity - Grab these values from User inputs


Ref - Link

GCP App Builder Notes

App type - Search / Chat / Recommendations



Data Source - Big Query / API / Site information




Architecture for Content Generation

Architecture for Chatbot



Google Retail 

Infuse your digital properties with Google-quality recommendations and search results that enhance user engagement, deliver personalized experiences

Using Google Online Analytics to personalize



Keep Exploring!!!