
Explore artificial intelligence and machine learning fundamentals for Go developers, from maze solving to natural language processing and neural networks.
Present an experienced software professional and university instructor with 25 years as an independent contractor, teaching since 1991, and PhDs in English literature, computer science, and education.
Install go across windows, mac, and linux by downloading from the official site, running the installer, updating the path, and verifying the installed version with go version.
Shows how to install visual studio code as the go development IDE, download from code.visualstudio.com for windows, linux, or mac, and install go language support and tools via command palette.
Set up Visual Studio Code for Python, install Python, and manage versions from Python 3.13 onward, then use the rough fix extension to auto fix issues and format imports.
Study search algorithms for traversing graphs, both weighted and unweighted, including BFS, DFS, Dijkstra's, and A-star. Compare uninformed and informed searches and apply to mazes and networks.
Define mazes in text files with spaces for paths and # for walls, start at A and end at B, using zero-based coordinates, and load maze1.txt, maze2.txt, maze3.txt into Go.
Load maze text files into a Go program and define maze data structures. Parse start and end points, build a 2D wall grid, and configure command-line flags for search types.
Explore maze solving with uninformed search, starting from a fixed point, considering neighbors and walls, and applying depth-first and breadth-first strategies to reach the goal.
Learn to implement depth-first search in Go to solve a maze. Build node, wall, and solution types, manage a frontier, and reconstruct the path via neighbors.
implement a depth-first search maze solver in Go, time its performance, and print the maze and solution path while tracking steps and nodes explored.
Visualize a maze by outputting a finished maze PNG from Go code, drawing walls, the solution path, start and end points, and a grid with color-coded cells.
Learn how to produce a maze-solving animation in Go by adding debug and animate flags, generating animated png frames, and visualizing DFS exploration step by step.
Explore breadth first search by implementing a BFS frontier that removes from the beginning, contrasting it with depth first search while solving a maze.
Implement Dijkstra's search in Go by using a priority queue and Manhattan distance to compute cost to goal inside a maze, comparing with depth-first and breadth-first search.
Add the Manhattan cost to maze images to visualize distances as part of the Dijkstra's algorithm. The lecture guides implementing print Manhattan cost, drawing distances, and selecting the lowest-cost neighbor.
Apply informed search strategies by using partial goal knowledge to guide exploration, focusing on greedy best-first search and the A star search alongside traditional uninformed methods.
Explore greedy best first search by using Manhattan distance to the goal, contrast with Dijkstra, and implement an informed search with a priority queue in a maze.
Explore the a* search overview, blending dijkstra’s approach with a heuristic to guide pathfinding. Learn to compute the sum of Manhattan distance and Euclidean distance in a maze.
Implement the A* search in Go by adding estimated cost to goal, a star priority queue, and print total cost during maze solving.
Learn to add obstructions by marking flooded cells in a maze, load them from a map file, render water in blue with a W, and prep pathfinding for water.
Explore how graphs model maps and networks, with nodes as locations and edges as roads, including latitude, longitude, speed limits, construction, and traffic, using Dijkstra and A* to find paths.
Program a robot vacuum to cover every open space using various graph search algorithms, including random walk, slam with A*, snake, and spiral, in a terminal simulation with a cat.
Set up a Go-based robot vacuum project in Visual Studio Code, define a grid-based room with furniture, and parse JSON configurations to control cleaning algorithms and animation.
Load room configuration from a JSON file, convert room dimensions to grid cells, add perimeter walls, count cleanable cells, and prepare a grid for AI navigation in Go.
Learn how to print a room grid to the terminal in Go, modeling a robot with position, path tracking, and a display function to render walls, furniture, and cleaning status.
Define a Go robot with a factory method and start coordinates, then implement a random-walk clean room routine that prints the terminal room and a detailed cleaning summary.
Load furniture from room.json, divide its x, y, width, and height by the cell size to map to the grid, and populate it with furniture obstacles named after each entry.
Define common robot cleaning utilities in Go, including directions, a clean function, check adjacent obstacles, and obstacle recording, preparing for the random walk cleaning algorithm.
Implement the A* algorithm in Go to guide a random walk, using a priority queue, open and closed sets, Manhattan distance as the heuristic, and path reconstruction.
Integrate A* pathfinding with a random walk cleaning strategy, set max moves and a stuck counter, and use Bresenham’s line to reach dirty cells.
Implement Bresenham's line algorithm in Go to draw a path between two points and move toward the nearest dirty cell until hitting an obstacle using Manhattan distance.
Finish the clean random walk function by moving a robot along a random angle with Bresenham's line algorithm, checking obstacles, and using A* to reach dirty cells.
Explore a clean random walk in go by running the program with and without animation, testing an empty room, room.json, seeing a Bresenham line, random directions, and 20-move swaps.
Explore the slam algorithm, a simultaneous localization and mapping method, and learn a simplified version that builds an internal map while navigating and cleaning the room.
Learn to scaffold a Go slam project by initializing a robot map, visited cells, and a frontier, and implementing update logic to label cells as unknown, free, obstacle, or cleaned.
Define a Go function add neighbors to frontier that uses the robot position, robot map, frontier, visited, and room to compute adjacent points and add valid neighbors.
Implement a for loop to reach the closest frontier point from the robot position, plan a path with a star, move and clean, update the map, and expand the frontier.
Implement a thorough frontier update every ten moves, using robot map, frontier, and visited checks to map free, accessible cells, and aim for 95% coverage with slam-style cleanup.
Finish the slam algorithm with final cleanup, compute cleaning time, and display the final statistics. Implement clean remaining cells via a star path and update the robot’s position.
Explore the spiral pattern search algorithm, or spiral matrix search, for cleaning rooms by starting near the center and expanding outward to cover all cleanable areas while avoiding obstacles.
Guide learners through implementing a spiral cleaning pattern in Go, initializing timing and move counts, centering the robot, using a star pathfinder to reach points, cleaning cells, and displaying statistics.
Implement a clean spiral pattern generator in Go by locating the room center, finding the nearest cleanable point, computing an a* path to the center, and generating spiral points.
Finishes the spiral algorithm to clean a grid using a star pathfinding approach, skipping cleaned or obstacle cells, updating the robot position, and performing final cleanup.
Learn how the boustrophedon or snaking lawnmower path achieves coverage path planning and implement it in code more easily than the spiral pattern.
Develop a Go-based snaking algorithm to clean a room by generating a lawnmower pattern, avoiding walls and obstacles, and updating the robot's position and path.
Implement a snaking pattern with coverage points, compute path using a star, and animate a robot cleaning a room, finishing with a final sweep and final cleaning time.
demonstrates obstacle recognition by recording and listing encountered obstacles during cleaning, using a get encountered obstacles list function to display items like coffee table, bicycle, couch for propositional logic.
Create a Go cat entity by defining a cat struct, a factory, and movement logic with random start, direction, and path updates, marking grid cells dirty.
Add and move the cat in the room by using the move cat function, update the display to show robot and cat positions, and enable animation in Go.
Enhance your robot's intelligence by applying propositional logic to a knowledge-based agent, using simple rules, truth tables, and basic notation to draw conclusions.
Learn how to extend a Go robot vacuum project to support multiple rooms via a json config, with optional propositional logic for cleaning decisions.
Implement multi-room support in Go by iterating over house.rooms with a room counter, testing with house.json, and preparing to add propositional logic in the next lecture.
Define object-to-person rules using propositional logic and a truth table to guide robot decisions, such as vacuuming, avoiding areas, and skipping rooms based on who is home.
Implement propositional logic in Go to drive a robot's decisions by modeling a logical world with people and objects, using a constructor and rule-based updates.
Finish implementing the logical world by adding update door status and determine cleaning priority, and introduce a robot with logic to follow room rules and home state.
Define a robot with logic, embedding a robot and a logical world, then scan the house to map rooms, identify furniture, assign rooms to occupants, and determine cleaning priority.
Implement propositional logic to guide a logic-aware robot in cleaning a house, using a logical world to track people, doors, and room priorities, and iterating on Go code.
Finish implementing the propositional logic robot in Go (Golang) by refining room existence checks, updating object findings, and executing prioritized cleaning based on house.json.
Learn model checking, contrasting it with propositional logic, using a world of true/false values and a knowledge base to decide loan qualifications.
Launch a simple loan-approval AI in Go, using model checking to verify fairness and risk, with weighted factors and CSV data.
Load applicants from loan_applicants.csv in a modular Go program. The lecture shows setting up a model file and load CSV function, mapping headers, parsing floats and booleans, with error handling.
Define and implement fairness and risk properties in Go to validate loan approval models, using an interface-driven property check and testing with protected versus non-protected groups.
Implement the risk property in Go by defining high risk as credit score below 0.5 and debt to income above 0.5, compute and enforce the high risk approval rate limit.
Finalize the model checking workflow by creating test models with set weights and thresholds, then verify the model against fairness and risk properties with sample applicants.
Explore uncertainty and randomness by building a terminal battleship game where a human and an AI make intelligent guesses to locate ships.
Begin a go battleship project on a ten by ten board with an ai opponent. Set up boilerplate in main.go, define symbols, place ships, and run a turn-based loop.
Define ship types and a 2D board in Go for battleships, then implement human and AI player structures with position tracking and a heat map for targeting.
Create and initialize an AI player in Go, including a factory method, heat map setup, and potential ships tracking, then pair it with a human opponent.
Describe how the Go AI player places battleship ships with an intelligent strategy that mixes edge and center placements, avoids adjacency, and falls back to random placement when needed.
Learn how to implement human ship placement in a Go battleship game, including printing both boards, parsing coordinates like A0 to J9, validating bounds and overlaps, and updating ship positions.
Implement a human turn in a Go battleship-style game by printing boards, prompting for a target, validating input, applying hits or misses, and checking win conditions.
Learn to implement the AI turn in a Go battleship game by updating the heat map and selecting targets via hunt mode or probability targeting.
Learn how to apply hunt mode boosts to a heat map by analyzing hit patterns (single, horizontal, vertical) and boosting neighboring cells for smarter targeting.
Learn how the AI takes a turn by updating the heat map, selecting a target through hunt mode or probability targeting mode, firing, and updating hit, miss, and sunk ships.
Print and observe the heat map as the Go program updates the game state, analyze center-heavy values, and test heat-map generation and hunt-mode logic.
Improve heatmap functionality in Go by applying the ship fit bonus across all potential ship cells and moving checks outside the loop; lower the hunt mode boost to 15.
Determine if a hit sinks a ship by checking all parts of horizontal or vertical ships on the opponent’s board, returning true and the ship name.
Finalize a go-based battleship game by hiding AI ships, pausing after turns, and testing user-vs-AI play. Learn how AI and probability shape gameplay and spark heat map improvements.
Build a blackjack knowledge-based agent that uses the Hi-Lo card counting system and true count with perfect memory to track the deck and cards played.
Build a blackjack game in Go, from setup and a 52-card deck to a loop with an AI card counter. The AI tracks cards and estimates probabilities against the dealer.
Learn to clear the screen across platforms in Go, build a 52-card deck with suits and values, implement shuffling using Fisher-Yates, and enable drawing cards for a blackjack game.
Implement a high-low card counting strategy for an AI player by tracking a running and true count, assigning +1 to 2–6, 0 to 7–9, and -1 to tens and aces.
This lecture implements a Go-based card counting module for a blackjack AI, building a card counter with seen cards, running and true counts, deck remaining, and bust probability computations.
Implement a blackjack flow in Go by reshuffling a low deck, resetting the card counter, and creating three players—the human, AI, and dealer, with an initial two-card deal.
Implement score calculation and add-card functionality for all three players, deal two cards each, update scores with ace logic (11 or 1), and track cards during the initial deal.
Implement a Go method to display each player's hand in a blackjack game, hiding the dealer's second card and printing formatted card strings and scores.
Implement the ai turn in go, wiring deck, card counter, and dealer up card to decide hit or stand using probabilities, true count, and high-low.
Explore implementing a blackjack dealer turn in a Go-based ai game, counting seen cards with a card counter to compute running and true counts and inform decisions.
Explore supervised learning with linear regression and multiple linear regression to predict house prices using Python, emphasizing data cleaning, train-test split, and model evaluation.
Set up a Python virtual environment, load house data from CSV, and preprocess by removing missing values and outliers to prepare data for linear regression.
Prepare data for modeling by configuring an 80/20 train-test split with a 42 random state, scale features, and train a linear regression model using sklearn, ready for evaluation.
Evaluate a trained model on both training and test data using the shared scaler, compute r squared and RMSE, and log the results to illustrate model performance.
Learn to evaluate a linear regression model by printing results, computing r-squared and rmse, and displaying training and test data with Python, NumPy, and pandas.
Create a Python visualization of the data by plotting training and test points with a regression line, using a configured figure size, colors, and saving as an image.
Extend a linear regression tool to predict house prices for unseen data using a dash predict flag, square footage input, and a trained model with scaling.
Build a multiple linear regression model in Python to predict housing prices from square footage and bedrooms, while setting up a virtual environment and organizing project modules.
Implement data processing capabilities for housing price analysis by loading, validating, and pre-processing data with pandas, numpy, and sklearn using config-driven checks and error handling.
Train a linear regression model with scaling, evaluate with R2 and RMSE on train and test data, and enable saving and loading with pickle via the ModelResults data class.
Save and load a trained model from disk using pickle, and store related metadata in JSON. Create directories as needed, handle errors, and compute intercept and coefficients for the model.
debug and validate a housing analysis setup by correcting six typos across data processing and model modules, importing components, and a command-line interface for training, evaluating, saving, and predicting.
Learn to display regression results and create simple visualizations by printing the model formula, r squared and rmse for training and testing, and showing sample predictions with dataframes.
Learn to create data for 2d and 3d visualizations of square footage and bedrooms by combining training and test data, computing ranges and means, and building regression lines and planes.
Create a 2d visualization of regression results by plotting training and test housing data side by side with a regression line, using matplotlib and config-driven styling.
Create a 3d visualization of regression results by plotting training data, test data, and a regression plane in a 3d matplotlib plot, with axis labels, a legend, and optional display.
Solve linear and multiple linear regression problems using Go, compare Go's speed and typing with Python's GPU training, and outline training in Python and serving in Go.
Build a Go-based linear regression app that supports simple or multiple regression with many features. Demonstrate parsing command line flags to configure data paths, targets, and features.
Set up types and data handling in Go for AI, then load and validate data, and remove outliers using an interquartile range approach with a utils package.
Define a linear regression model in Go with a dedicated model package, including coefficients, intercept, features, target, and R squared, and implement persistence with save/load to JSON metadata.
Learn to load and prepare data for a Go regression model by building a data context, parsing CSV into a data frame, and printing pre- and post-outlier summaries.
Build a Go model handler to load and prepare data from a csv, validate the file path, and wire a data context for linear regression training.
Normalize features in Go by standardizing values to zero mean and unit variance, returning normalized features with means and standard deviations and handling empty input and zero-division with epsilon.
Train simple and multiple linear regression models in Go by validating data frame columns, normalizing features, building a design matrix, computing coefficients via the normal equation, and evaluating with r-squared.
Create a linear regression model summary printer that outputs the regression equation and model fit statistics, plus coefficient interpretations for each feature and normalization status.
Learn to train a linear regression model with prepared training data, features and target, print the model summary, including coefficients, intercept, and r-squared.
Learn how to save a trained Go model to a JSON file and load it back for predictions, including error handling, config-driven paths, and validation with a data context.
Implement a predict method for a linear regression model in Go, handling intercepts and normalization, with a practical workflow using task to train, save, load, and predict.
Set up the handlePrediction function to process command-line input for a linear regression model, validate features, parse key-value pairs, and build input data for prediction and display.
implement and display a prediction table in go by printing a header of features, formatting predictions from a linear regression model, and validating with a sample prediction.
Clone the visualization API from GitHub, run it as a docker sidecar for your Go application, and post JSON to render an HTML data plot.
Write go code to call the sidecar application via a JSON regression request, including x, y, labels, and layout; switch between 2d and 3d plots based on features.
Go code builds predicted values as a data series, connects to a sidecar plotting service, marshals json, saves an html plot, and opens it in the browser.
Practice plotting in Go by enabling the plot flag with config, data model, and data context, then visualize via docker compose and train to load a pre-trained json model.
Modify the python linear regression tool to save the trained model as json, enabling the Go program to load coefficients, intercept, features, and r squared for prediction.
Load a Python-trained JSON model into a Go program, specify features like square_footage and bedrooms, and predict house prices using linear regression, preparing for neural networks.
Explore how neural networks learn via forward propagation, loss, and backpropagation, tune learning rate and epochs, and build a CNN for image classification using Python and PyTorch with ONNX.
Set up a Python neural network project with PyTorch, a virtual environment, and a requirements file; prepare housing price data with Pandas and NumPy, and save the model to ONNX.
Learn to load and preprocess data for model training with command line flags, csv data, train/val/test splits, feature and target scaling, and tensor conversion for GPUs.
Load and preprocess data from a housing dataset, unzip file into the project root, and run a Python training script to inspect device usage and data shapes while fixing typos.
Configure command line flags in main.py for training, including model path, onnx model, scalar path, input features, epochs, learning rate, patience, and min delta. Apply these options during training only.
Set up command line train and predict modes, build a three-layer house price predictor neural network (3-64-32-1) with ReLU, train it, and save as Onnx for cpu or gpu.
Define a train_model function to train a neural network with early stopping, using MSE loss and Adam optimizer, validate on a validation set, and evaluate test metrics after inverse transform.
Call the training loop in main.py with train_model, passing the model, data splits, epochs, learning rate, and early stopping, then assess mean squared error and r-squared results.
Save a trained PyTorch model as an onnx file and pickle the feature and target scalers, using an export workflow with dynamic axes and explicit input/output names.
Load a saved ONNX model and the scalar pickle; validate input features; perform ONNX runtime inference; inverse-transform the prediction to dollars and print the result.
Try inference with the Onyx-based predict function by providing input features, model path, and scalar path, after fixing typos, to predict a real estate price.
Explore building an image classifier using convolutional neural networks to distinguish cats from dogs, including dataset setup, Python and PyTorch dependencies, and training a CNN with TorchVision.
Launch a CNN training workflow with PyTorch and Onnx, using argparse to manage data paths, image size, augmentation, and hyperparameters for cat vs dog inference.
Define a setup_device function to choose a torch device between cuda for Nvidia, Apple MPs for metal performance shaders, or cpu, and print the selected backend.
Learn to load and prepare data for training a model, including training and validation loaders, optional data augmentation, and device-aware execution on CPU or GPU.
Define a cat dog CNN using PyTorch, building four convolutional blocks with batch normalization and max pooling, followed by fully connected layers and dropout.
Define the forward pass through four convolutional blocks with conv, bn, relu, pool. Flatten the feature maps and classify with two fully connected layers and dropout for cat or dog.
Load data, define the model, and set up cross-entropy loss, SGD with momentum, weight decay, and the learning-rate scheduler for training a two-class classifier.
Learn to implement a train_model function that trains and validates a model using training and validation data loaders, a loss function, optimizer, scheduler, and optional early stopping, and tracks accuracy.
Explain how to implement an early stopping mechanism to terminate training when validation loss stops improving, using a dedicated class with patience and min delta parameters to prevent overfitting.
Identify and load the best model state, report its validation accuracy, and save the trained model to PyTorch and Onnx formats for deployment, including image dimensions and device.
Learn to persist trained models by saving PyTorch state_dict and exporting to Onnx, using eval mode, a dummy input, and robust error handling for portable deployments.
Set up and run inference for a trained PyTorch or Onnx model, preprocess images with transforms, and predict cat or dog with confidence scores.
Experiment with image inference on cat and dog pictures, debug command flags and model paths, and tune hyperparameters, augmentation, learning rate, batch size, and epochs, to boost neural network accuracy.
Are you a Go developer ready to explore the exciting world of AI and machine learning? This course is your comprehensive guide, designed specifically for Gophers who want to add powerful AI skills to their toolkit.
Much of the code in this course is written in Go, but some of it is written in Python, where it makes sense to do so, and this means that before taking this course you should have a basic understanding of both languages.
We'll start with fundamental AI concepts, building a strong foundation with practical, hands-on projects. Then, we'll dive into the world of machine learning, tackling everything from classic regression models to modern neural networks. You'll learn how to leverage Go for high-performance AI applications, and discover how to integrate it with Python and cutting-edge tools like Hugging Face and LLMs for state-of-the-art solutions.
What You'll Learn
Search Algorithms & Intelligent Agents: Master core AI search algorithms like A* and Dijkstra's by solving mazes and building a robot vacuum.
Propositional Logic & Model Checking: knowledge based AI agents often need to make decisions based on available information in the world they operate in. Propositional logic and model checking are two different approaches to solving this problem.
Uncertainty: Learn how AI agents handle randomness by creating a Battleship AI and a card-counting Blackjack player.
Machine Learning Fundamentals: Get a practical understanding of linear regression by building models in both Python and Go to predict housing prices.
Deep Learning & Neural Networks: Build a neural network from scratch for housing price prediction and a Convolutional Neural Network (CNN) for image classification.
Natural Language Processing (NLP): Discover the power of NLP by creating an extractive summarization program in Go. You'll also learn to interface with external models from Hugging Face and harness the power of Large Language Models (LLMs) to create hybrid summarization systems.
Large Language Models (LLMs): Learn how to connect your Go programs to Large Language Models like ChatGPT. We'll use a locally hosted LLM using Ollama, but the code we write will be 100% compatible with OpenAI, which is used to connect to most LLMs.
Course Requirements
This course is for intermediate to advanced Go developers. You should be comfortable with Go syntax and core concepts. A basic understanding of data structures like graphs and trees is also helpful, but not required. You should also have a basic understanding of Python.
All you need is a computer running Windows, macOS, or Linux. While a GPU will speed up certain deep learning tasks, it is not essential; everything will run on a CPU.
Why This Course?
This isn't just another machine learning course; it's tailored for Go programmers. You'll learn how to build production-ready AI and machine learning applications that leverage Go's performance and concurrency. By the end, you'll have a portfolio of projects and the skills to confidently build your own intelligent applications.
Ready to build the future of AI with Go? Enroll now and start your journey!