Code Monkey home page Code Monkey logo

examples's Introduction

Layer Example Projects

This repository contains example projects that you can use to get started with Layer.

Layer is a collaborative MLOps platform where you can build, train, version and share your machine learning (ML) models.

Install Layer

The first step is to install Layer:

pip install layer

Clone the examples repository

The first step is to clone this repository:

git clone https://github.com/layerai/examples

Select an example project

Next, select one example project and change into that folder. Let's use the Titanic example for illustration:

cd examples/titanic

Open the associated notebook or Python script and run it. Layer runs your project and places the generated entities in the appropriate Discover tabs.

Use the generated entities in a Jupyter Notebook

Entities generated with Layer can also be accessed in a Jupyter Notebook. Layer allows you to access the datasets, feature sets, and models.

First, let's look at how to access the created datasets:

import layer
dataset = layer.get_dataset('layer/titanic/datasets/passengers')

The model can be accessed using Layer get_model function:

import layer
model = layer.get_model('layer/titanic/models/survival_model')

The model can be used to make predictions right away:

df = layer.get_dataset("passengers").to_pandas()
passenger = df[['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare']]
survival_probability = model.get_train().predict_proba(passenger.sample())[0][1]
print(f"Survival Probability: {survival_probability:.2%}")

# > Survival Probability: 68.37%

Next steps

To learn more about using layer, you can:

examples's People

Contributors

mwitiderrick avatar buraklayer avatar mecevit avatar dougmc-layer avatar volkangurel avatar eminn avatar yuranos avatar

Stargazers

Lực Cui avatar  avatar Ünver Çiftçi avatar Shaun avatar Alper Kocabiyik avatar Pavlos Mitsoulis-Ntompos avatar Michael avatar

Watchers

Gerard Maas avatar Dimitar Popov avatar Katherine Bulatova avatar Michel Lebeau avatar  avatar  avatar  avatar

examples's Issues

multi-gpus training

may i use multi-gpus to train t5 model? the example just support simple gpu training.

layer.login() error!

Hi~
when i layer.login(), I received this error message:

gaierror Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/aiohttp/connector.py in _create_direct_connection(self, req, traces, timeout, client_error)
998 # across all connections.
--> 999 hosts = await asyncio.shield(host_resolved)
1000 except asyncio.CancelledError:

23 frames
gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

ClientConnectorError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/aiohttp/connector.py in _create_direct_connection(self, req, traces, timeout, client_error)
1009 # in case of proxy it is not ClientProxyConnectionError
1010 # it is problem of resolving proxy ip itself
-> 1011 raise ClientConnectorError(req.connection_key, exc) from exc
1012
1013 last_exc = None # type: Optional[Exception]

ClientConnectorError: Cannot connect to host app.layer.ai:443 ssl:default [Name or service not known]

my i use my own vocabulary

I want to train t5 from scratch, and use my own vocabulary.

the model i can load like this:
config = T5Config.from_json_file(config_file)
model = T5ForConditionalGeneration(config)

the vocabulary is like this below, it seems the tokenizer cannot load this vocab. how should i load this to a proper tokenizer?
{
"": 0,
"": 1,
"": 2,
"": 3,
"": 4,
",": 5,
"的": 6,
"?": 7,
"了": 8,
.....
.....
.....
"<s_181>": 33786,
"<s_182>": 33787,
"<s_183>": 33788,
"<s_184>": 33789,
"<s_185>": 33790,
"<s_186>": 33791,
"<s_187>": 33792,
"<s_188>": 33793,
"<s_189>": 33794
}

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.