back to blog

Github Copilot live AI coding demo with Zachary Burkett

Read Time 5 mins | Written by: Cole

Github Copilot live AI coding demo with Zachary Burkett

In this AI-assisted live coding demo, Zachary Burkett, puts GitHub Copilot to the test by building a machine learning model from scratch in real time. Working in VS Code, he leverages Copilot to generate a full PyTorch script that trains a convolutional neural network (CNN) on the MNIST dataset, a classic benchmark of handwritten digit recognition. 

Along the way, he showcases how AI can:

  • Speed up code generation: Watch as Copilot creates a training and testing framework, allowing Zachary to rapidly prototype a CNN.
  • Enhance experimentation: See multiple optimization algorithms Adam, SGD, and RMSprop integrated seamlessly to compare performance.
  • Streamline visualization: Follow the integration of TensorBoard and custom image grids, which help track training progress and visualize predictions.

Zachary’s demo highlights the efficiency of AI-assisted development and reinforces the importance of human oversight. While Copilot automates repetitive tasks, the developer’s role in verifying code accuracy, ensuring security, and fine-tuning performance remains crucial. 

Watch GitHub Copilot in action.

Watch live GitHub Copilot demo

 


Or read through a quick summary of the conversation below.

Use GitHub Copilot to train a convolutional neural network (CNN)

Zachary demonstrates how AI can assist in developing a machine learning model using GitHub Copilot. He sets up a Python script to train a convolutional neural network (CNN) on the MNIST dataset, a standard dataset of handwritten numerical digits. The goal is to quickly generate a training and testing script with AI assistance.

  • Zachary sets up a live demonstration of developing a simple machine learning model using AI assistance.
  • He begins with a Python script to train a convolutional neural network (CNN) on the MNIST dataset, which consists of handwritten numerical digits.
  • He uses GitHub Copilot in VS Code to generate a training and testing script for the model.

AI-assisted code generation and modification

Using AI tools, Zachary generates a PyTorch-based training script for the CNN and refines it as needed. He emphasizes that AI won't replace developers but rather improve their efficiency. Developers still need to verify AI-generated code to ensure correctness and avoid errors.

  • The AI tool generates a script for training the CNN using PyTorch and the Adam optimizer.
  • Zachary verifies and fine-tunes the generated code, demonstrating human oversight in AI-assisted development.
  • He highlights that AI won't replace developers, but rather helps them be more efficient.
  • The importance of understanding the code AI generates is emphasized to ensure correctness and prevent costly mistakes.

Testing multiple optimizers

Zachary enhances the script by testing multiple optimization algorithms (Adam, SGD, and RMSprop). This allows for performance comparison across different approaches using AI-assisted code modifications.

  • Zachary modifies the script to test different optimizers (Adam, Stochastic Gradient Descent (SGD), and RMSprop).
  • The AI tool updates the code accordingly, allowing the same script to run multiple experiments with different optimizers.
  • Results show that Adam optimizer and RMSprop perform better than SGD, confirming expectations.

Adding visualization to improve model understanding

To better interpret the model’s performance, Zachary integrates visualization features. These include logging training progress in TensorBoard and displaying predicted labels for the dataset images.

  • Zachary uses AI to enhance the script by:
    • Logging training loss to TensorBoard.
    • Displaying image predictions in a grid format with their labels.
  • AI-assisted tools generate and modify code inline, allowing him to quickly iterate and improve his workflow.
  • The model achieves 98-99% accuracy, demonstrating quick and efficient model training.

Impacts on AI-assisted software development

A developer raises concerns that AI tools can slow down workflow. Zachary offers practical advice on selecting efficient AI models, structuring prompts effectively, and integrating AI tools into development environments for a seamless experience.

  • A developer expresses concerns about AI tools slowing down their workflow.
  • Zachary suggests:
    • Choosing better models (e.g., O1 Mini, Claude Sonnet).
    • Providing clear, structured prompts to AI.
    • Integrating AI tools into development environments for seamless collaboration.
    • Starting with menial tasks (e.g., test writing) to get comfortable with AI-generated code.

Privacy concerns in AI-assisted development

Concerns about data privacy and security in AI-assisted development are discussed. Zachary and the panel suggest secure solutions, including enterprise AI tools, local models, and cloud-based services that protect sensitive code.

  • A question arises about privacy risks when using AI coding assistants.
  • Recommendations for secure AI-assisted development:
    • Using enterprise AI tools that don’t train on user data.
    • Running models locally to prevent data leaks.
    • Cloud-based managed services (e.g., AWS, Azure) that ensure data security.

Find senior AI/ML software engineering teams to speed up software development

You could spend the next 6-18 months planning to recruit and build an AI team (if you can afford it), but you won’t be building any AI capabilities. That’s why Codingscape exists. 

We can assemble a senior AI development team for you in 4-6 weeks (with experts like Zachary). It’ll be faster to get started, more cost-efficient than internal hiring, and we’ll deliver high-quality results quickly.

Zappos, Twilio, and Veho are just a few companies that trust us to build their software.

You can schedule a time to talk with us here. No hassle, no expectations, just answers.

Don't Miss
Another Update

Subscribe to be notified when
new content is published
Cole

Cole is Codingscape's Content Marketing Strategist & Copywriter.