ENH: Update GFDL to accept random states as inputs

Open
#134 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
numpy, python, scikit-learn

Research direction

The payload names no file, so begin by finding where GFDL takes its random seed argument and where it draws the weights and biases. The issue points to scikit-learn's random state handling, including the linked PR, as the model. Done means an integer seed still gives identical results across fits, and a numpy RandomState gives fresh weights and biases on each fit. No test file is named, so check the existing tests for seeding before adding new ones.

Written by the indexing model from the issue text.

Description

enhancement

The current implementation of GFDL only accepts integers as random seeds. I am proposing we also allow GFDL to accept random states. This is standard for sklearn and it is a feature that has already been implemented in @eiviani-lanl's sklearn PR.

Effect: If multiple iterations of GFDL are initialized and fit on the same data with the same integer random seed, they should return the same results. If multiple iterations of GFDL are initialized with the same numpy random state and then fit on the same data, the weights and biases should be resampled every time GFDL is called.

Motivation: To cross-validate GFDL, it is a recommended practice to resample the weights and biases with each fold (see sklearn documentation). This can be accomplished by initializing a GFDL estimator with a random seed, then feeding it into any of sklearn's cross-validation methods (see here).

This will also be useful during our hyperopt runs; if our cross-validation checks sample over multiple sampled biases/weights, then they will be more robust to changes in the random seed.

Dominant language
Python
Stars
3
Forks
6
Avg merge
1d 3h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lanl/GFDL

All issues in lanl/GFDL

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.