Saturday, January 11, 2025

AI Learning Roadmap

 Learning to create AI Agents is a fascinating journey that combines elements of programming, machine learning, and problem-solving. Here's a breakdown of how you can embark on this learning process:

1. Build a Strong Foundation:
  • Programming Fundamentals:
    • Python: This is the most common language for AI and machine learning due to its readability, extensive libraries, and active community. Learn basic syntax, data structures, control flow, and object-oriented programming concepts.
    • Other Languages (Optional): While Python is primary, knowledge of languages like JavaScript (for web-based agents) or C++ (for performance-critical applications) can be beneficial later.
  • Mathematics:
    • Linear Algebra: Vectors, matrices, matrix operations are essential for understanding many machine learning algorithms.
    • Calculus: Derivatives and gradients are crucial for understanding optimization techniques used in training models.
    • Probability and Statistics: Understand probability distributions, hypothesis testing, and statistical inference.
2. Dive into Machine Learning (ML):
  • Core Concepts:
    • Supervised Learning: Regression, classification, various algorithms like linear regression, logistic regression, support vector machines (SVMs), decision trees, random forests, and neural networks.
    • Unsupervised Learning: Clustering (k-means, hierarchical clustering), dimensionality reduction (PCA), anomaly detection.
    • Reinforcement Learning (RL): Learning through trial and error, concepts like Q-learning, SARSA, policy gradients, and deep reinforcement learning.
  • Libraries and Frameworks:
    • Scikit-learn: A great library for general-purpose machine learning, offering implementations of many standard algorithms.
    • TensorFlow and PyTorch: Powerful frameworks for building and training deep learning models. Choose one and learn it well.
    • Keras: A high-level API that simplifies building neural networks, often used with TensorFlow or PyTorch.
  • Start with Simple Projects:
    • Handwritten digit recognition (MNIST dataset): A classic introductory project using neural networks.
    • Spam detection: A practical application of text classification.
    • Regression problems: Predicting house prices or other numerical values.
3. Understand AI Agent Concepts:
  • What is an AI Agent?
    • An agent that perceives its environment, takes actions, and learns to achieve a goal.
    • Differentiated from simple AI models by their ability to interact with an environment.
  • Key Components:
    • Perception: How the agent receives information about the environment (sensors, data).
    • Decision-Making: How the agent chooses actions (algorithms, policies).
    • Action: How the agent affects the environment.
    • Learning: How the agent improves over time based on experience.
  • Types of Agents:
    • Reflex Agents: Simple agents that react to current percepts without considering history.
    • Model-Based Agents: Maintain an internal model of the world.
    • Goal-Based Agents: Act to achieve a specific goal.
    • Utility-Based Agents: Maximize a utility function that quantifies the desirability of states.
  • Environments:
    • Fully Observable vs. Partially Observable: Can the agent perceive all aspects of the environment?
    • Deterministic vs. Stochastic: Are actions predictable?
    • Discrete vs. Continuous: Are the state and action spaces discrete or continuous?
4. Learn Reinforcement Learning (RL) in Detail:
  • The core of AI agents: RL is essential for enabling agents to learn to make decisions in dynamic environments.
  • Key RL Concepts:
    • Markov Decision Processes (MDPs): A mathematical framework for modeling decision-making problems.
    • Exploration vs. Exploitation: Finding a balance between trying new things and exploiting known good strategies.
    • Rewards and Punishments: The signals that guide the agent's learning.
    • Value Functions: Estimating the long-term reward of being in a particular state.
    • Policy: The agent's strategy for selecting actions.
  • RL Algorithms:
    • Q-Learning, SARSA: Table-based RL algorithms for discrete state and action spaces.
    • Deep Q-Networks (DQNs): Combining Q-learning with deep neural networks for high-dimensional state spaces.
    • Policy Gradient Methods (e.g., REINFORCE, PPO, A2C): Directly learning the policy.
  • RL Environments:
    • Gym (OpenAI): A toolkit for developing and comparing reinforcement learning algorithms, offering a variety of environments.
    • Custom Environments: Create environments tailored to your specific needs.
5. Practice and Build Projects:
  • Start with Simple Agents:
    • Grid-world navigation: An agent learning to navigate a simple grid environment.
    • Game-playing agents (e.g., Tic-Tac-Toe, simple games in Gym): Apply RL to train agents to play games.
  • Gradually Increase Complexity:
    • More complex game environments (e.g., Atari games using DQN).
    • Developing agents for more realistic tasks.
    • Experiment with different RL algorithms and architectures.
  • Contribute to Open-Source Projects: This is a great way to learn from others and get real-world experience.
6. Stay Updated:
  • Follow Research Publications: Keep up with the latest advancements in AI and RL.
  • Attend Conferences and Workshops: Learn from experts and network with others.
  • Online Courses and Tutorials: Resources like Coursera, edX, Udacity, and YouTube are invaluable for continuous learning.
  • Online Communities and Forums: Engage with other learners and experts to ask questions and share knowledge.
Key Resources:
  • Online Courses:
    • Coursera's "Machine Learning" by Andrew Ng.
    • Udacity's "Deep Reinforcement Learning Nanodegree".
    • edX's "AI Professional Certificate".
  • Books:
    • "Reinforcement Learning: An Introduction" by Sutton and Barto (free online version).
    • "Deep Learning" by Goodfellow, Bengio, and Courville (free online version).
  • Libraries and Frameworks:
    • Scikit-learn
    • TensorFlow
    • PyTorch
    • Keras
    • OpenAI Gym
  • Websites:
    • OpenAI
    • DeepMind
    • Google AI
Tips for Success:
  • Be Patient and Persistent: Learning AI takes time and effort. Don't get discouraged by initial challenges.
  • Focus on Understanding the Fundamentals: Don't just memorize code; strive to understand the underlying concepts.
  • Start Small and Build Up: Begin with simple projects and gradually increase the complexity.
  • Practice Regularly: The more you code and experiment, the better you'll become.
  • Collaborate with Others: Learn from your peers and share your knowledge.
In summary, learning to create AI agents is a multifaceted process that requires a solid foundation in programming, math, and machine learning, with a strong focus on reinforcement learning. By following this roadmap, practicing consistently, and staying updated with the latest advancements, you can embark on a rewarding journey in this exciting field!

Friday, January 10, 2025

AI Agents

 Types of Agents:


1. Simple Reflex Agents

Ex : Thermostat


2. Model-Based Reflex Agents

Ex - Traffic management 


3. Goal Based Agent


Ex - Robotic arms


4. Utility-Based Agents


Ex: Investment ago 


5. Learning Based


6. Hierarchical 

Sunday, December 22, 2024

Generative AI

 ChatGPT is developed by company OpenAI. This product became the first fastest growing internet product hitting 100 Million users in just 2 months. 

It was just a research project to ensure AGI (Artificial General Intelligence) is achieved for the benefits of humanity. 


ChatGPT refers to chat enabled version of Generative Pretrained Transformer model.


The company OpenAI is working with Microsoft since 2016 using Azure Cloud to train and run AI models. 


OpenAI APIs are hosted on Azure servers but it is maintained by OpenAI only. 

Microsoft has its own version of OpenAI api called AzureOpenAI Api. 








Thursday, December 19, 2024

Machine Learning

Machine learning is a subset of AI that applies mathematics to large datasets to find trends and patterns while mapping inputs to outputs. 

Such as, given these features of a home, age, location, and the number of bedrooms as input, what will the selling price be? This means computers can produce output without being explicitly programmed by a developer or software engineer. 

Model
The mappings uncovered between the inputs and outputs are stored in a mathematical model, simply called the Model. 


Implementing Machine Learning project has two options:

1. Train a model from Scratch
2. User a pretrained Model

Pretrained Model sources:

1. ModelZoo.com

2. AWS Marketplace 

3. Hugging Face

Train a custom model (Creating model from Scratch)

1. Using Python

2. Using R

3. Using Java


To work with Phython, the environment is Jupyter Notebook


Machine Learning Framework Libraries:

1. scikit-learn 
2. TensorFlow
3. MXNet 
4. PyTorch
5. Keras




Wednesday, December 18, 2024

Day2 - Artificial Intelligence

NumPy - A library in Python for basic operations

Pandas - Based on Numpy, it is another library

Installed Jupyter Notebook

MatplotLib: A library

Seaborn

Cufflinks: is a Python library that simplifies interactive plotting. It allows you to create interactive charts directly from Pandas DataFrames or Series.

Kaggle is a fantastic platform for accessing high-quality datasets to practice and develop your skills in machine learning, data science, and artificial intelligence. 

Kaggle is one of the largest global hosting platforms used by data scientists and machine learning enthusiasts globally. 

Founded in 2010 and acquired by Google in 2017, Kaggle always supported a diverse set of tools and resources to enable learning, collaboration, and innovation.

Kaggle is best known for its competition platform, through which it hosts users to face real-world problems. Companies, researchers, and organizations pose competition. These challenges include easy tasks in predictive modelling as well as highly complex machine learning problems, oftentimes with large sums of money on the line. Besides the competitions, there are also several thousands of publicly available datasets in Kaggle, encompassing various domains including finance, healthcare, and social sciences among others. 

The importance of these datasets to experimentation, learning, and community-driven project contributions cannot be overemphasized.

Sunday, December 15, 2024

Introduction to Artificial Intelligence (AI)

Artificial intelligence (AI) refers to the computer systems capable of performing complex tasks that historically only a human could do, such as reasoning, making decisions, or solving problems. 

It involves creating machines that can think like humans and imitate their actions.

Types of AI

  1. Narrow AI (Weak AI):

    • Designed to perform a single task.
    • Example: Virtual assistants like Siri or Alexa.
  2. General AI (Strong AI):

    • Has human-like cognitive abilities across multiple domains (still theoretical).
    • Example: A machine capable of understanding, reasoning, and learning any task a human can do.
  3. Super AI:

    • Surpasses human intelligence (currently a concept).

Key concepts:

1. Machine Learning: focuses on developing systems that learn or improve performance, based on the data. Example: Predicting weather or stock prices.

2. Deep Learning: A subset of ML using neural networks to mimic the human brain. Example: Image and speech recognition.

3. Neural Networks: Enables machines to understand and generate human language. Example: Chatbots and language translators.

4. Datasets: Datasets are large collections of information that AI systems use to learn.

5. LLM

6. NLP

7. Computer Vision: Focuses on enabling machines to interpret visual data. Example: Facial recognition systems.

Machine Learning:

1. Supervised Learning: is a learning process where algorithm learns from labeled data.

Tools for Supervised Learning:

  • Python Libraries:
    • scikit-learn.
    • TensorFlow.
    • PyTorch.
  • Platforms:
    • Azure ML, AWS SageMaker, Google AI.
  • 2. Unsupervised Learning 

    3. Reinforcement Learning 





    Saturday, June 29, 2024

    AWS Lambda

    What is Serverless : 

     Pay for what you use

    Service automatically scales up or down accordingly. 

    AWS Lambda allows upload the code to Amazon aws without the need of the server. 

    AWS Lambda is a Function as a service (FaaS) which is a serverless architecture that developers can use to write custom backend functions and deploy the function code directly to the cloud infrastructure

    It falls under the Compute services in AWS. 

    Process:

    1. Create a lambda function

    2. Upload to AWS 

    3. Test and trigger

    Lambda execution models:

    1. Synchronous 

    2. Asynchronous

    3. Pull stream based