.

Members-Only

Recent Talks & Demos are for members only

Exclusive feed

You must be an AI Tinkerers active member to view these talks and demos.

January 29, 2025 · Medellín

Magic: AI Deck Building

This talk explores building Magic: The Gathering decks using basic AI techniques like tf/idf to calculate card synergy and optimize deck composition without relying on large language models.

Overview
Tech stack
  • TF-IDF
    TF-IDF (Term Frequency-Inverse Document Frequency) is a statistical measure that quantifies a term's relevance in a document by multiplying its local frequency (TF) with its global rarity (IDF).
    TF-IDF is a core statistical method in information retrieval and text mining: it assigns a numerical weight to a word, signaling its importance within a document relative to a larger corpus. The calculation is direct: Term Frequency (TF) measures how often a word appears in the document, and Inverse Document Frequency (IDF) scales that value down if the word (like 'the' or 'a') is common across all documents. The final TF-IDF score emphasizes terms that are frequent in a specific document but rare overall (e.g., 'quantum' in a physics paper). This vectorization process is crucial for applications like building search engine relevance rankings and training machine learning models for text classification.
  • TensorFlow
    Google's open-source, end-to-end platform for building, training, and deploying machine learning models across all environments.
    TensorFlow is the open-source, end-to-end machine learning platform developed by the Google Brain team . It provides a comprehensive ecosystem of tools for model development: Keras simplifies high-level neural network construction, and TensorBoard offers visualization and debugging . The framework is engineered for scalability, supporting distributed training on powerful hardware like Google's custom Tensor Processing Units (TPUs) . Crucially, its ecosystem—including TensorFlow Lite for mobile/edge devices and TensorFlow.js for web browsers—ensures deployment flexibility, allowing models to run on servers, microcontrollers, or directly in a browser .
  • PyTorch
    PyTorch is the open-source machine learning framework: it provides a Python-first tensor library with strong GPU acceleration and a dynamic computation graph for building deep neural networks.
    PyTorch, developed by Meta AI, is a premier open-source deep learning framework favored in both research and production environments. Its core is a powerful tensor library (like NumPy) optimized for GPU acceleration, delivering 50x or greater speedups for complex computations. The key differentiator is its 'Pythonic' design and dynamic computation graph (eager execution), which allows for rapid prototyping and simplified debugging compared to static-graph frameworks. Leveraging its Autograd system for automatic differentiation, practitioners build and train models for computer vision and NLP; major companies like Tesla (Autopilot) and Microsoft utilize PyTorch for critical AI applications.
  • scikit-learn
    Scikit-learn (sklearn) is the essential Python library for efficient, production-ready machine learning, built on NumPy and SciPy.
    Scikit-learn (sklearn) is the industry-standard Python library, providing a unified API for efficient predictive data analysis. It delivers robust, open-source implementations of core machine learning algorithms: classification (e.g., Support Vector Machines, Random Forests), regression (e.g., Linear Regression), and clustering (K-Means, DBSCAN). Built on the foundational scientific stack (NumPy, SciPy), its consistent Estimator API simplifies complex data science workflows. Developers use it to quickly move from data preprocessing (StandardScaler) to model evaluation (accuracy_score) and pipeline construction in production environments.
  • Keras
    Keras is a multi-framework deep learning API (written in Python) that runs on top of JAX, TensorFlow, or PyTorch.
    Keras 3 is the multi-framework deep learning API, designed for human-centric development: it focuses on reducing cognitive load and enabling fast experimentation. It provides a simple, consistent interface for building models, from basic Sequential stacks to complex Functional API architectures. The framework offers industry-strength performance and scalability, leveraging backends like JAX for optimized training on GPUs and TPUs. Organizations like NASA, YouTube, and Waymo utilize Keras for production-grade applications, proving its power and reliability across computer vision and NLP domains.
  • GPT-4
    GPT-4 is OpenAI’s large multimodal model: it processes both text and image inputs, delivering human-level performance on complex professional and academic benchmarks.
    This is OpenAI’s latest milestone in scaling deep learning: a large multimodal model accepting both text and image inputs. It demonstrates a significant capability leap over its predecessor, scoring in the top 10% on a simulated bar exam (GPT-3.5 scored in the bottom 10%). The model handles nuanced instructions and long-form content, supporting context windows up to 32,768 tokens (32K model). This capacity allows processing up to 25,000 words in a single, complex prompt. GPT-4 is engineered for enhanced reliability, steerability, and advanced reasoning across diverse tasks.
  • GPT-3
    A 175-billion parameter autoregressive language model that masters complex tasks through few-shot learning.
    OpenAI debuted GPT-3 in 2020: a transformer-based engine trained on 570GB of filtered text. It utilizes 175 billion parameters to execute diverse functions (including Python scripting and logical reasoning) using only natural language prompts. This architecture removed the requirement for task-specific fine-tuning: establishing the foundation for modern tools like GitHub Copilot and the initial ChatGPT release.
  • BERT
    BERT (Bidirectional Encoder Representations from Transformers) is a foundational, pre-trained NLP model that uses a Transformer encoder to process text bidirectionally, capturing full word context for superior language understanding.
    BERT is a revolutionary language representation model introduced by Google AI Language in 2018. It is built on the Transformer architecture and distinguishes itself by being deeply bidirectional: it processes the entire sequence of words (left and right context) simultaneously, unlike previous unidirectional models. This capability is achieved through a Masked Language Model (MLM) pre-training objective. The model, released in sizes like BERTBASE (110 million parameters) and BERTLARGE (340 million parameters), dramatically improved the state-of-the-art across 11+ Natural Language Processing tasks, including question answering (SQuAD) and sentiment analysis, establishing a new baseline for the field.
  • ONNX
    ONNX (Open Neural Network Exchange) is an open-source format: it standardizes machine learning models, ensuring interoperability across all major frameworks and deployment hardware.
    ONNX delivers critical model portability. It defines a standardized computation graph and operator set, allowing developers to train a model in one framework (e.g., PyTorch or TensorFlow) and deploy it seamlessly using a different runtime. This eliminates framework lock-in and optimizes production performance. Founded in 2017 by key industry players (AWS, Microsoft, Facebook), ONNX now boasts contributions from companies like NVIDIA, Intel, and Qualcomm. The high-performance ONNX Runtime, for example, powers AI inference across major Microsoft products, including Windows, Office, and Azure Cognitive Services, demonstrating its enterprise-grade efficiency and cross-platform capability (cloud, edge, mobile).

Related projects