Code Monkey home page Code Monkey logo

shelf's People

Contributors

nicholasjng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cav71

shelf's Issues

Check path qualification before prepending prefix

Currently, we unconditionally prepend self.prefix before the rpath in Shelf.(get|put).

This will of course break if self.prefix is not the empty string and the rpath is already fully qualified (i.e. has leading protocol and separator).

Hence, we need to omit the prefix if the input path is already fully qualified.

Add support for multi-file type instantiation

Currently, types that require multiple distinct files to load (think neural networks with a parameter file and a hyperparameter file) are not supported, and if they are, it's probably by accident.

def load_from_disk(param_file: str, hparam_file: str) -> MyModel:  # needs both files to load successfully
    params = load_params(param_file)
    hparams = load_hparams(hparam_file)
    return MyModel(params, hparams)

Loading artifacts from multiple files should look something like this:

m = shelf.get(["s3://my-bucket/my-file1.txt", "s3://my-bucket/my-file2.txt"], MyModel)

BUT, in case the files are saved in a directory prefix, shelf could allow the following shortcut:

# in S3:
# my-bucket/my-file1.txt
#          /my-file2.txt

m = shelf.get("s3://my-bucket/", MyModel)  # assumes that there are no other files in "my-bucket".

The latter case is not trivial at all, though. What happens if the files are not passed to the type deserializer in the correct order? I'm not sure that they are currently sorted in any order, actually. Might require a custom type order field to set on the IO struct.

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.