GithubHelp home page GithubHelp logo

nvidia-merlin / models Goto Github PK

View Code? Open in Web Editor NEW
239.0 24.0 48.0 115.26 MB

Merlin Models is a collection of deep learning recommender system model reference implementations

Home Page: https://nvidia-merlin.github.io/models/main/index.html

License: Apache License 2.0

Python 99.69% Makefile 0.18% Shell 0.13%
deep-learning machine-learning pytorch recommendation-system recommender-system tensorflow dask gpu rapidsai recsys

models's People

Contributors

ajschmidt8 avatar al-yakubovich avatar albert17 avatar ayodeawe avatar bbozkaya avatar benfred avatar bschifferer avatar edknv avatar emmaqiaoch avatar gabrielspmoreira avatar jperez999 avatar karlhigley avatar marcromeyn avatar markmotrin avatar mengyao00 avatar mikemckiernan avatar nv-alaiacano avatar oliverholworthy avatar qy2205 avatar radekosmulski avatar rhdong avatar rnyak avatar rvk007 avatar sararb avatar tien-nguyen avatar wonderingwj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

models's Issues

[FEA] Validate Models on large datasets with extra columns

The issue is: How to validate models on large datasets and analyze by additional columns?

In our examples, we predict each batch and store a copy in a separate Tensor + store a copy of the targets. After we iterate over all batches, we concatenate them and calculate the performance.

  • What happens, when the dataset is too large, that the predictions and targets do not fit in memory?
  • What happens, if we want to calculate the performance of the models per category? (e.g. only new users)? These categories may be not used during training (not part of X).

[RMP] Ranking - TF : Wide and Deep, DLRM, DeepFM

The initial version should support some common ranking models like

  • DLRM
  • Wide and Deep
  • Factorization Machines

DeepFM - Factorization Machine - https://arxiv.org/abs/1703.04247

Learning sophisticated feature interactions behind user behaviors is critical in maximizing CTR for recommender systems. Despite great progress, existing methods seem to have a strong bias towards low- or high-order interactions, or require expertise feature engineering. In this paper, we show that it is possible to derive an end-to-end learning model that emphasizes both low- and high-order feature interactions. The proposed model, DeepFM, combines the power of factorization machines for recommendation and deep learning for feature learning in a new neural network architecture. Compared to the latest Wide & Deep model from Google, DeepFM has a shared input to its "wide" and "deep" parts, with no need of feature engineering besides raw features. Comprehensive experiments are conducted to demonstrate the effectiveness and efficiency of DeepFM over the existing models for CTR prediction, on both benchmark data and commercial data.

Aha! Link: https://nvaiinfa.aha.io/features/MERLIN-727

[PR] YouTubeDNN - hidden_dims and activations must be same same length

This will fail silently in this branch if hidden_dims and activations are different lengths.

https://github.com/NVIDIA-Merlin/models/blob/feature/retrieval-dnn/merlin_models/tensorflow/models/retrieval/youtube_dnn.py#L39

from merlin_models.tensorflow.models.retrieval import YouTubeDNN


YouTubeDNN(continuous_columns=[], 
           categorical_columns=[], 
           embedding_dims=[], 
           hidden_dims=[128, 128], 
           activations=None)

Solution:

import tensorflow as tf

from merlin_models.tensorflow.layers import DenseFeatures


class YouTubeDNN(tf.keras.Model):
    """
    https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45530.pdf
    See model architecture diagram in Figure 3
    """

    def __init__(self, continuous_columns, categorical_columns, embedding_dims, hidden_dims=None, activations=None):

        super().__init__()

        hidden_dims = hidden_dims or []
        activations = activations or []

        if len(hidden_dims) != len(activations):
            raise ValueError('"hidden_dims" and "activations" must be the same length.')

        channels = self.channels(continuous_columns, categorical_columns, embedding_dims)

        self.input_layer = DenseFeatures(channels["categorical"] + channels["continuous"])

        self.hidden_layers = []
        for dim, activation in zip(hidden_dims, activations):
            self.hidden_layers.append(
                tf.keras.layers.Dense(
                    dim,
                    activation=activation,
                    activity_regularizer="l2",
                )
            )

    def channels(self, continuous_columns, categorical_columns, embedding_dims):
        if not isinstance(embedding_dims, dict):
            embedding_dims = {col.name: embedding_dims for col in categorical_columns}

        embedding_columns = [
            tf.feature_column.embedding_column(col, embedding_dims[col.name])
            for col in categorical_columns
        ]

        return {"categorical": embedding_columns, "continuous": continuous_columns}

    def call(self, inputs, training=False):
        x = self.input_layer(inputs)
        for layer in self.hidden_layers:
            x = layer(x)
        return x

Commit to solve: 1c7bc3d

Add pip and conda packages

We should have pip and conda packages for merlin models.


Aha! Link: https://nvaiinfra.aha.io/features/MERLIN-516

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.