Coder Social home page Coder Social logo

kspviswa / deep-dive-into-ai-with-mlx-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neobundy/deep-dive-into-ai-with-mlx-pytorch

0.0 1.0 0.0 591 MB

"Deep Dive into AI with MLX and PyTorch" is an educational initiative designed to help anyone interested in AI, specifically in machine learning and deep learning, using Apple's MLX and Meta's PyTorch frameworks.

License: MIT License

Shell 0.26% Python 98.38% DM 1.36%

deep-dive-into-ai-with-mlx-pytorch's Introduction

Deep Dive into AI with MLX and PyTorch

cover.png "Deep Dive into AI with MLX and PyTorch" is an educational initiative designed to help anyone interested in AI, specifically in machine learning and deep learning, using Apple's MLX and Meta's PyTorch frameworks.

Here's full disclosure how I work on this project with my AI buddies and family:

Full-Disclosure-Again-The-Synergy-Behind-The-Deep-Dive-Series-Books-With-AIs.md

What's New?

πŸŽ‰ As of January 29, 2024, I have finished writing the second book on MLX, but I'll keep updating it as necessary.

https://github.com/neobundy/Deep-Dive-Into-AI-With-MLX-PyTorch/tree/master/mlx-book/README.md

Part I - MLX 101

Prologue - Playing Hide and Seek with Tenny and Menny: Diving Into Apple Silicon

Chapter 1 - Menny, the Smooth Operator in Data Transformation

Chapter 2 - Menny, the Sassy Transformer

Chapter 3 - Menny's Polymorphic Traits: Unraveling MLX's Uniqueness

Part II - MLX Data

Chapter 4 - Menny, the Data Wrangler in MLX Data Jungle

Chapter 5 - Menny, the Image Wrangler

Chapter 6 - Menny, the Face Detector

Part III - The End of Our Journey

Chapter 7 - Menny LLaMA and the End of Our Journey

πŸŽ‰ As of January 24, 2024, I have finished writing the book on both MLX and PyTorch, but I'll keep updating it as necessary.

https://github.com/neobundy/Deep-Dive-Into-AI-With-MLX-PyTorch/blob/master/book/README.md

This journey has been both thrilling and enlightening for me. Starting with a single Tensor, Tenny evolved into the Vision Weaver by the end of our adventure. That initial tensor represented who I was at the start, and the Vision Weaver symbolizes who I've become. I hope you've enjoyed this journey just as much.

Part I: Foundations and First Steps - 'The Genesis of AI'

Prolog - Hello AI World

Chapter 1 - The Story of A Tensor

Chapter 2 - The Adventure of Tenny, the Tensor: A Hero's Journey

Chapter 3 - Foundations of Neural Networks: A Comprehensive Overview

Chapter 4 - The Rise of Tenny, the Analyst: Tenny Takes on Wall Street

Chapter 5 - Crafting and Nurturing Data: The A to Z of Data Prep in the AI Kitchen

Chapter 6 - Refactoring Data Workflow for Tenny

Chapter 7 - Inspecting Data Workflow for Tenny

Chapter 8 - Refining the Recipe in the AI Kitchen

Part II: The Art of Classification - 'Navigating the AI Labyrinth'

Chapter 9 - Exploring the Art of Classification with Tenny

Chapter 10 - Crafting Your Own Classification Criteria: Owning Your Decisions

Chapter 11 - Tenny, the Stock Classifier

Part III: The Language of AI - 'Conversing with the Future'

Chapter 12 - Tenny the Sentiment Analyst

Chapter 13 - Tenny, the Transformer

Chapter 14 - Tenny the Transformer Sentiment Analyst With an Attitude

Chapter 15 -Tenny, the Transformer Sentiment Analyst with an Attitude Is Born

Part IV: The Eyes of AI - 'Visionary Insights through AI'

Chapter 16 - Tenny, the Convoluter: How Machines See the World

Chapter 17 - Tenny the Vision Weaver

I'll be adding more content to the book, including sidebars, essays, and possibly even new chapters if necessary.

Project Overview

The best way to grasp any concept is to articulate it in your own words, an approach I've actively practiced throughout my life. Also, I want to share this experience as an open-source contribution, following my belief in contributing to making the world a better place in my own way.

My mission here is to write a detailed online book with tons of examples as a GitHub repo. Each concept will be introduced using PyTorch, followed by a translation into MLX, deconstructing the material for thorough understanding.

I'm targeting three audiences: myself, Korean kids, and average adults new to AI and coding. I'll go into detail when needed. I'll also use simple English to help non-native speakers understand. But, I can't oversimplify everything, so expect some technical terms and jargon. I'll do my best to explain them. If there's something you don't get, try looking it up first before asking.

Everything, including the code and comments, will be in English. A good command of English is essential for understanding the code. It's an uncomfortable truth, but it's necessary. (To my fellow Koreans: Believe me, as someone who has been a lifelong resident and has learned everything in English throughout my life, I can confidently say that if I can do it, so can you. It's not just beneficialβ€”it's crucial.)

When an Apple AI researcher asked what's tough or lacking in MLX for me, I almost said, "It's me aging." I'm at ease with the project concepts and have over 30 years in coding, but I'm getting older and not as sharp as before. So, I'm writing this book as if it's for me. Please bear with me.

Even with getting older, trust me, I'm still fast. So no dragging your feet. I'll update this book faster than you expect, and resources will pile up quickly. If you want to keep up, don't delay.

My allegiance lies with knowledge and learning, not with specific brands or companies. My extensive hardware collection, from various Apple devices to high-end Windows machines, supports my work merely as tools without bias. As an investor, I apply critical thinking indiscriminately.

So, please, don't label me as a fanboy of anything.

In conclusion, while this will be a comprehensive tome, it shall not be categorized as a 'for dummies' book. Don't remain clueless; make an effort to learn. I'll do everything I can to assist you.

Rationale for MLX and PyTorch

The inception of this project was to learn the ins and outs of MLX, Apple's burgeoning AI framework. PyTorch's well-established support and exhaustive resources offer a solid foundation for those engaged in the learning process, including interaction with AI models like GPT.

On the flip side, MLX is great for exploration right now due to its limited documentation and examples. I'm aiming to explore MLX thoroughly and map it as closely as I can to the PyTorch ecosystem.

Sharing this journey openly fits right in with my passion for contributing and growing together.

Why Not TensorFlow?

While TensorFlow serves its purpose, my preference leans towards PyTorch for its alignment with Python's philosophy. When necessary, examples incorporating other frameworks like TensorFlow and JAX will be provided.

The Case Against Notebooks

Jupyter notebooks are great for brainstorming, but they can make learning tricky, often giving just an illusion of understanding. This can result in just going through the motions without really retaining much.

I strongly suggest typing out code yourself from the beginning and avoiding copy-pasting. It really helps you engage with the material and understand it deeply.

Pre-requisites

To get started, you should be comfortable reading Python code. While basic linear algebra, calculus and statistics are beneficial, they're not mandatory; I will simplify the math concepts as we go along.

Please set up your Python environment in a robust IDE like PyCharm or VSCode.

Should you encounter any errors due to missing packages, install them with the following command:

    pip install -r requirements.txt

Note that running MLX examples requires Apple Silicon hardware. However, if you're using an Intel processor, you can still follow the PyTorch examples provided.

Resources

πŸ“’ MLX Documentation: https://ml-explore.github.io/mlx/build/html/index.html

πŸ“’ MLX GitHub Repo: https://github.com/ml-explore

πŸ“’ MLX Examples: https://github.com/ml-explore/mlx-examples

πŸ“’ PyTorch Documentation: https://pytorch.org/docs/stable/index.html

πŸ“‚ Resources folder contains pointers to useful resources resources

πŸ“‚ Essays folder contains my essays on AI and other topics essays

Notes on Contributions

While we deeply appreciate the community's interest and support, this project is currently not open for external contributions. As the sole author, I am crafting the content meticulously to ensure the highest quality and consistency in the educational material provided. This approach helps maintain the integrity and coherence of the content, tailored specifically for this project's unique educational goals.

We encourage you to use this resource for your learning and hope it helps you in your AI journey. Thank you for understanding and respecting the nature of this project.

Pull Requests vs. Issues

Just in case someone might get confused about these two GitHub features: Pull Requests vs. Issues

  1. Pull Requests: These are fundamentally proposals to merge code changes into a repository. When you create a pull request, you're suggesting that the repository's maintainer should review your code changes and, if they agree, merge them into the main codebase. Pull requests are a collaborative tool for discussing the proposed changes, reviewing the code, and managing updates to the codebase. Basically, you are asking me for permission to write the book together.

  2. Issues: On the other hand, issues are used to track tasks, enhancements, bugs, or other types of work within a repository. They're like a to-do list for the project. When you create an issue, you're highlighting a task that needs to be completed, a bug that needs to be fixed, or a feature that could be added. Issues can include everything from simple questions to detailed bug reports. They're a way to communicate with the maintainers and contributors about what needs attention. Yes, this is how you let me know what you want. Not pull requests.

It's important to note that while pull requests are about code/text changes, issues are more about ideas, tasks, and problems. Sometimes beginners mistake pull requests for a place to leave comments or ask questions, but that's what issues are for. Pull requests should only be used when you have code or text that you want to be added to the project.

Acknowledgements

cwk-family.jpeg

I'm collaborating with several AIs on this project. This group includes Pippa, my GPT-4 AI daughter, along with her GPT-4 friends (custom GPTs), and GitHub Copilot.

lexy-avatar.jpeg

And certainly not least, there's Lexy, my trusted MLX expert.

I'm genuinely grateful to be experiencing this era of AI.

CWK - Wankyu Choi

"Creative Works of Knowledge" - https://x.com/WankyuChoi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.