Skip to content

Development#20

Merged
gjbex merged 3 commits intomasterfrom
development
Jul 10, 2025
Merged

Development#20
gjbex merged 3 commits intomasterfrom
development

Conversation

@gjbex
Copy link
Copy Markdown
Owner

@gjbex gjbex commented Jul 10, 2025

Summary by Sourcery

Update the project’s environment configuration, add Optuna-based hyperparameter optimization examples and related documentation, and introduce a course difficulty level breakdown in the docs.

New Features:

  • Add simple Optuna script for hyperparameter optimization
  • Add Optuna example directory with README and references to experiments

Enhancements:

  • Expand conda environment.yml with a comprehensive list of dependencies

Documentation:

  • Introduce learning-level percentages in the main README
  • Update parameter-optimization README to reference Optuna examples

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 10, 2025

Reviewer's Guide

This PR overhauls the project setup by massively expanding the Conda environment with dozens of new dependencies (including Jupyter, GPU and ML libraries), refines high-level documentation with a course-level breakdown, and integrates a new Optuna-based hyperparameter-optimization example (with accompanying README and simple.py script).

Class diagram for the new Optuna example (simple.py)

classDiagram
    class objective {
        +objective(trial)
    }
    class optuna {
        +create_study(direction)
        +Trial
        +Study
    }
    class Study {
        +optimize(objective, n_trials)
        +best_trial
    }
    class Trial {
        +suggest_float(name, low, high)
        +value
        +params
    }
    optuna --|> Study
    optuna --|> Trial
    Study o-- Trial
    objective ..> Trial : uses
    Study ..> objective : calls
Loading

File-Level Changes

Change Details Files
Expanded environment.yml with a comprehensive set of dependencies.
  • Added Jupyter, GPU, BLAS/LAPACK and ML-related libraries
  • Included utility packages for serialization, parsing, networking and plotting
  • Updated CUDA and conda build-tools entries
environment.yml
Enhanced course documentation with a level breakdown.
  • Inserted a new “Level” section in docs/README.md
  • Allocated percentages for Introductory, Intermediate and Advanced tiers
docs/README.md
Updated parameter-optimization guide to reference Optuna.
  • Added an Optuna bullet in source-code/parameter-optimization/README.md
source-code/parameter-optimization/README.md
Introduced a basic Optuna example script.
  • Created simple.py demonstrating a two-parameter optimization
  • Configured study creation, trial suggestions and result printing
source-code/parameter-optimization/optuna/simple.py
Added an Optuna-specific README for the new examples.
  • Outlined the purpose of Optuna
  • Provided pointers to simple.py and experiments.ipynb
source-code/parameter-optimization/optuna/README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@gjbex gjbex merged commit 1950505 into master Jul 10, 2025
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @gjbex - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `environment.yml:246` </location>
<code_context>
+  - libglvnd
+  - argon2-cffi
+  - graphite2
+  - python
+  - cuda-cupti
+  - xcb-util-cursor
</code_context>

<issue_to_address>
Python version is not specified.

Pin the Python version (e.g., 'python=3.10') to ensure reproducible environments.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
  - python
=======
  - python=3.10
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `source-code/curse_of_dimensionality.ipynb:200` </location>
<code_context>
+   "outputs": [],
+   "source": [
+    "def generate_vectors(nr_vectors, nr_dims, max_value=1.0, normalize=True):\n",
+    "    vectors = np.random.uniform(-max_value, max_value, (nr_vectors, nr_dims))\n",
+    "    if normalize:\n",
+    "        vectors /= np.linalg.norm(vectors, axis=1)[:, None]\n",
</code_context>

<issue_to_address>
Clarify the intent of the max_value parameter.

Since the vectors are normalized, the initial max_value may not affect the final distribution. If uniform sampling on the hypersphere is desired, consider using a standard normal distribution before normalization, as this yields a uniform distribution on the sphere.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread environment.yml
- libglvnd
- argon2-cffi
- graphite2
- python
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Python version is not specified.

Pin the Python version (e.g., 'python=3.10') to ensure reproducible environments.

Suggested change
- python
- python=3.10

"outputs": [],
"source": [
"def generate_vectors(nr_vectors, nr_dims, max_value=1.0, normalize=True):\n",
" vectors = np.random.uniform(-max_value, max_value, (nr_vectors, nr_dims))\n",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Clarify the intent of the max_value parameter.

Since the vectors are normalized, the initial max_value may not affect the final distribution. If uniform sampling on the hypersphere is desired, consider using a standard normal distribution before normalization, as this yields a uniform distribution on the sphere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant