assignment2 (2)
assignment2 (2)
1 Objective
The goal of this assignment is to create a simple AI model for linear regression using the Rust programming
language and the burn library. The model should predict the output of the function y = 2x + 1 using
synthetic data for training. You will use the burn library version 0.16.0 and other dependencies as specified
in the provided Cargo.toml file. You are free to use AI, documentation, and other resources to complete
the task. Once completed, submit the link to your GitHub repository on Blackboard LMS and provide a
detailed writeup in Markdown.
2 Requirements
2.1 Setup Rust and Rust Rover IDE
1. Install Rust:
• Download and install Rust from https://www.rust-lang.org/tools/install.
• Verify the installation by running rustc –version in your terminal.
2. Install Rust Rover IDE:
• Download Rust Rover from https://www.jetbrains.com/rust/.
• Follow the installation instructions for your operating system.
3. Create a New Rust Project:
• Open Rust Rover and create a new project using the cargo new or you can do this on command
line and then open project in Rust Rover. For console creattion do command:
cargo new l i n e a r _ r e g r e s s i o n _ m o d e l
cd l i n e a r _ r e g r e s s i o n _ m o d e l
• Replace the contents of the Cargo.toml file with the provided TOML configuration:
[ dependencies ]
burn = { v e r s i o n = ” 0 . 1 6 . 0 ” , f e a t u r e s = [ ” wgpu ” , ” t r a i n ” ] }
burn - ndarray = ” 0 . 1 6 . 0 ”
rand = ” 0 . 9 . 0 ”
rgb = ” 0 . 8 . 5 0 ”
textplots = ”0.8.6”
• Do not use any other content under [dependencies] in the Cargo.toml file other than what is
above. Any changes that DON NOT match what is above under [dependencies] will result in a
score of zero marks.
4. Connect Rust Rover to GitHub:
1
• Install Git from https://git-scm.com/.
• In Rust Rover, go to VCS > Enable Version Control Integration and select Git.
• Create a new repository on GitHub and link it to your project. You can use command line:
git init
git remote add o r i g i n <your - github - repo - u r l >
git add .
git commit -m ” I n i t i a l commit”
git push -u o r i g i n main
2.3 Documentation
1. Write a Detailed README:
• Include steps to set up the project and run the code.
• Explain how you approached the problem, including any challenges you faced.
• Document the resources you used (e.g., AI tools, library documentation, tutorials).
2. Reflect on Your Learning:
• Describe how much help you received from AI, documentation, or other sources.
• If you failed to solve the problem, explain why and what you learned from the experience.
3 Submission Guidelines
1. Push your code to the GitHub repository you created.
2. Ensure the Cargo.toml file is unchanged from what is in this document.
3. Include a detailed README.md file in your repository where you will do your writeup.
4. Submit the link to your GitHub repository on Blackboard LMS.
5. Provide a detailed writeup in Markdown format in your README.md file. The writeup should
include:
2
• An introduction to the problem.
• A description of your approach.
• Results and evaluation of the model.
• Reflection on your learning process.
4 Resources
• Rust Documentation: https://doc.rust-lang.org/
• Burn Library Documentation: https://docs.rs/burn/0.16.0/burn/
• GitHub Guide: https://docs.github.com/en/get-started
5 Evaluation Criteria
• Correct Implementation: The model should correctly predict y = 2x + 1.
• Adherence to Requirements: The Cargo.toml file must remain unchanged as is in this document.