# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.17.1 # --- # %% [markdown] """ # Welcome to TinyTorch! ๐Ÿš€ You're about to build your own neural network framework from scratch! First, let's get your environment ready in 3 quick steps: 1. ๐Ÿ“ฆ Install packages 2. โœ… Check versions 3. ๐Ÿ‘‹ Set up basic info That's it! Let's begin your AI journey. """ # %% nbgrader={"grade": false, "grade_id": "setup-imports", "locked": false, "schema_version": 3, "solution": false, "task": false} #| default_exp core.setup #| export import sys import platform # %% [markdown] """ ## Step 1: Install Required Packages ๐Ÿ“ฆ First, we'll install the few packages TinyTorch needs (like NumPy for arrays). """ # %% nbgrader={"grade": false, "grade_id": "setup-install", "locked": false, "schema_version": 3, "solution": true, "task": false} #| export def setup(): """Install required packages.""" import subprocess try: subprocess.run(["pip", "install", "-r", "requirements.txt"], check=True, capture_output=True, text=True) print("โœ… Packages installed successfully!") except subprocess.CalledProcessError as e: print(f"โŒ Installation failed: {e}") print("๐Ÿ’ก Try: pip install -r requirements.txt") except FileNotFoundError: print("โŒ requirements.txt not found") print("๐Ÿ’ก Make sure you're in the TinyTorch directory") # %% [markdown] """ ### ๐Ÿงช Test: Package Installation """ # %% nbgrader={"grade": true, "grade_id": "test-setup", "locked": true, "points": 5, "schema_version": 3, "solution": false, "task": false} def test_setup(): """Test setup function.""" print("๐Ÿ”ฌ Testing setup...") # Test that function exists and is callable assert callable(setup), "setup should be callable" # Run setup setup() print("โœ… Setup function works!") # %% [markdown] """ ## Step 2: Check Your Environment โœ… Let's make sure everything installed correctly. """ # %% nbgrader={"grade": false, "grade_id": "check-versions", "locked": false, "schema_version": 3, "solution": true, "task": false} #| export def check_versions(): """Quick version check.""" try: import numpy as np print(f"๐Ÿ Python: {sys.version_info.major}.{sys.version_info.minor}") print(f"๐Ÿ”ข NumPy: {np.__version__}") print(f"๐Ÿ’ป Platform: {platform.system()}") print("โœ… All versions look good!") except ImportError as e: print(f"โŒ Missing package: {e}") print("๐Ÿ’ก Run setup() first to install packages") # %% [markdown] """ ### ๐Ÿงช Test: Version Check """ # %% nbgrader={"grade": true, "grade_id": "test-versions", "locked": true, "points": 5, "schema_version": 3, "solution": false, "task": false} def test_check_versions(): """Test check_versions function.""" print("๐Ÿ”ฌ Testing version check...") # Test that function exists and is callable assert callable(check_versions), "check_versions should be callable" # Run version check check_versions() print("โœ… Version check function works!") # %% [markdown] """ ## Step 3: Basic Course Info ๐Ÿ‘‹ Just some simple info for the course. """ # %% nbgrader={"grade": false, "grade_id": "basic-info", "locked": false, "schema_version": 3, "solution": true, "task": false} #| export def get_info(): """Get basic user info for course.""" # Students can customize this info return { "name": "Your Name", "email": "your.email@example.com", "platform": platform.system(), "python_version": f"{sys.version_info.major}.{sys.version_info.minor}" } # %% [markdown] """ ### ๐Ÿงช Test: Basic Info """ # %% nbgrader={"grade": true, "grade_id": "test-basic-info", "locked": true, "points": 5, "schema_version": 3, "solution": false, "task": false} def test_get_info(): """Test get_info function.""" print("๐Ÿ”ฌ Testing basic info...") # Test that function exists and is callable assert callable(get_info), "get_info should be callable" # Get info info = get_info() # Test return type and structure assert isinstance(info, dict), "get_info should return dict" assert "name" in info, "Should have name" assert "email" in info, "Should have email" # Display results print(f"Name: {info['name']}") print(f"Email: {info['email']}") print("โœ… Basic info function works!") # %% [markdown] """ ## ๐Ÿงช Complete Setup Test """ # %% nbgrader={"grade": true, "grade_id": "test-complete", "locked": true, "points": 10, "schema_version": 3, "solution": false, "task": false} def test_complete_setup(): """Test complete setup workflow.""" print("๐Ÿ”ฌ Testing complete setup...") # Test all functions work together setup() check_versions() info = get_info() print("\n๐ŸŽ‰ SETUP COMPLETE! ๐ŸŽ‰") print(f"Welcome {info['name']}!") print(f"Email: {info['email']}") print("โœ… Ready to build neural networks!") if __name__ == "__main__": print("๐Ÿš€ TinyTorch Simple Setup!") print("Quick and easy environment setup...\n") # Run all tests print("๐Ÿ“ฆ Step 1: Package Installation") test_setup() print() print("โœ… Step 2: Version Check") test_check_versions() print() print("๐Ÿ‘‹ Step 3: Basic Info") test_get_info() print() print("๐Ÿงช Step 4: Complete Test") test_complete_setup() print("\n" + "="*50) print("๐ŸŽ‰ TINYTORCH SETUP COMPLETE! ๐ŸŽ‰") print("="*50) print("โœ… Packages installed") print("โœ… Versions verified") print("โœ… Basic info collected") print("โœ… Ready to build AI!") print("\n๐Ÿš€ Next: Module 2 - Tensors!") # %% [markdown] """ ## ๐Ÿค” Your AI Journey Starts Here! Time to think about what you want to create! """ # %% nbgrader={"grade": true, "grade_id": "question-excitement", "locked": false, "points": 10, "schema_version": 3, "solution": true, "task": false} """ ### What Are You Most Excited to Build? Write one sentence about what AI application you want to create! YOUR ANSWER: TODO: Write what you're excited to build! """ ### BEGIN SOLUTION # Student writes their excitement ### END SOLUTION # %% [markdown] """ ## ๐ŸŽฏ MODULE SUMMARY: Welcome Complete! Congratulations! Your TinyTorch environment is ready! ๐ŸŽ‰ ### What You Accomplished โœ… Installed required packages โœ… Verified your environment works โœ… Set up course information ### What's Next? ๐Ÿš€ 1. Run: `tito module complete 01_setup` 2. Module 2: Learn about tensors (the foundation of AI) 3. Start building your neural network framework! You're officially ready to create AI from scratch! โšก """