Giter Site home page Giter Site logo

torsk's People

Contributors

jamesavery avatar nmheim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

torsk's Issues

Suggestion: Make parameters a dict

It's a bit awkward to address every parameter by name, as is needed when represented as fields in an object. For example, updating parameter values on the command line is much easier, if I could do

def update_params(params,args):
    for i in range(1,len(args),2):
        [key,value] = args[i:i+2];
        params[key] = eval(value)

Then the default values can sit in the json file, but it's quick to supply alternate values without having to change the json or source code.

Simple pure-numpy implemenation of sparse matrices w/ fixed number of nonzeros per row

Something along these lines:

class sparse_matrix_from_dense():
    def __init__(self,Adense,nz_per_row):
        self.ix_row, self.ix_col = np.nonzero(Adense);
        self.nz_per_row = nz_per_row
        self.values = Adense[self.ix_row,self.ix_col]
        
class sparse_matrix():
    def __init__(self,values,nz_per_row,ix_row,ix_col):
        self.values = values
        self.nz_per_row = nz_per_row
        self.ix_row = ix_row
        self.ix_col = ix_col
        
def sparse_dense_mm(A,X):
    AXv = A.values[:,None]*X[A.ix_col,:];
    return np.sum(AXv.reshape((-1,X.shape[1],A.nz_per_row))
                  
def sparse_dense_mv(A,x):
    Axv = A.values[:]*x[A.ix_col];
    return np.sum(Axv.reshape((-1,A.nz_per_row))

Feature request: Input map sequence, or rescaling parameter

Whenever we add a convolutional map, or another image transformation, we get a full multiple of the input image size added to the hidden variables. That quickly becomes very large.

Would like the possibility to downsample after applying the map, so that more features can be included without blowing up the size of the hidden space too much.

Store git hash and command line in all generated .nc-files

To make reproducibility a thing, we need to couple output with how it was generated. Since the software is a moving target, we both need the commit ID and the command line used to run the code.

The command line is just sys.argv; the git commit we need to read from .git (possibly on pip install -e, stored as a variable).

`TorchImageDataset` broken

Traceback (most recent call last):
  File "run.py", line 66, in <module>
    steps=1, step_length=2)
  File "/home/niklas/repos/toto/torsk/__init__.py", line 243, in train_predict_esn
    inputs, labels, pred_labels = dataset[idx]
  File "/home/niklas/repos/toto/torsk/data/torch_dataset.py", line 45, in __getitem__
    images = self._images[
AttributeError: 'TorchImageDataset' object has no attribute '_images'

Automatic removal of annual cycles

If an underlying periodicity is known a priori in the input data (as in many Earth-science datasets with a yearly cycle), it should be possible to specify the period length and ask us to automatically remove the average cycle before training.

This could either be done:

  • off-line as a preprocessing step (together with e.g. scaling and cosine transform), or
  • in the loader.
    In both cases, the average cycle is stored, and can be added back before displaying the result.

In the ocean data, the annual cycle is very clear in the cosine-transformed coefficients (less so in the pixel values).

In cases where the annual cycle is very dominant, this means that the NN doesn't need to spend its efforts reproducing it, possibly leading to missing the more subtle details that we're after.

Similarly, the (linear or quadratic) trend can be factored out of the data.

Repeated prediction/correction

Needed feature: Predict a shorter distance into the future, then retrain (or feed truth) to increment time, then predict again, etc.

PyTorch 1.0: start using `torch.jit.script_method` on forward functions

Tutorial that might be useful: here

Basically this has to be done:

To use script mode, be sure to inherit from the the torch.jit.ScriptModule base class (instead of torch.nn.Module) and add a torch.jit.script decorator to your Python function or a torch.jit.script_method decorator to your module’s methods.

Reservoir analysis

Check how ESN performance depends on condition number/rank of reservoir.
Compare that to performance of reservoirs that are created from the identity matrix/diagonal matrix with appropriate eigenvalues to which a random unitary transformation is applied.

Add time-component to IMED

Due to the large dimensionality along the t-axis, make G_t banded (possibly even tridiagonal), corresponding to limiting the "smearing" along the t-axis to nearby times.

Tridiagonal: correlates only one step ahead and one back. Probably we want a few more steps.

Add Bohrium support

TODO:

  • imed.py (turn imed_loss back on in test_run_kuro.py and test_run_mackey_2d.py
  • make it usable with params.backen = 'bohrium'
  • bohrium 2D convolutions?

Add feature to write video

Matplotlib is horrifically slow, and interpolates the data whether we want it or not. Would like to just write the actual pixels to video.

pinv and pinv-stable

Allow user to choose between stable (but slow) SVD-based pseudoinverse, which guarantees a maximal condition number, and the faster simple least-squares solver.

Fix variable dtypes

dtype can be changed with the new backend features that will be introduced with #26.
this does not work properly for pytorch at the moment.

Harness spatial information

There are several different ways how to make use of the spatial correlations in the SSH input images:

  1. Convolutional layers (problematic with masked images)
  2. Naive FFT (masked values set to zeros)
  3. Non-uniform FT (masked values can be excluded)
  4. Convolution on fourier-transformed images directly. (Problem: find the conv operator in k-space)

Hyperparameter optimization

Within every hpopt step, iterate over a number of tikhonov betas to find the best one. this will get rid of an optimization parameter.

hyperparameter optimization 2.0

Implement hyper paramter folder structure.

It might be feasible to precompute a lot of reservoirs with the following parameters:
* hdim: 5k, 10k, 15k, 20k
* precompute the spectral radius to scale later
* density: 1%
* input weight init

World data has wrong shape

Have a look at the first frame of the world data. The registered shape is transposed, which mangles the image. Needs to be SSH(ntime,nlat,nlon), but is SSH(ntime,nlon,nlat). @nmheim, can you fix this?

Datasets

Generic image/scalar dataset classes

class ImageDataset:
  def __init__(self, ...)

  def to_img(self)

  def to_feature(self, kwargs)
    # can specify: raw pixels, different convs, sct/dct (with weighted coefficients?!)

Initial glitch in predictions

Both for DCT / real predicitions there seems to be an initially bad prediction that surprisingly becomes better over time?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.