There are difference between GMF, MLP AND NeuMF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Explore how embeddings are created with Autoencoders | |
* https://blog.eto.ai/vector-similarity-search-with-duckdb-44dec043532a | |
* https://medium.com/kirey-group/autoembedder-training-embedding-layers-on-unsupervised-tasks-fc364c0f6eec | |
* https://www.kaggle.com/code/marlesson/autoencoder-embedding-for-food/notebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regs = regs or [0, 0] | |
user_input = Input(shape=(1,), dtype="int32", name="user_input") | |
item_input = Input(shape=(1,), dtype="int32", name="item_input") | |
user_embeds = Embedding( | |
input_dim=num_users, | |
output_dim=embed_size, | |
embeddings_initializer="normal", | |
embeddings_regularizer=l2(regs[0]), | |
input_length=1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% solvers for DEs in ode.m | |
% TODO Insert relevant values into `range` and `initial_conditions` | |
% NOTE initial_conditions is a vector (ordered collection) of input values that will | |
% unpacked in ode.m file into the X, L, S, N, and H variables respectively. | |
range = [1:50] | |
initial_conditions = [600, 3, 0, 3, 3] | |
# Use ode45 solver | |
[time_solution, var_solution] = ode45(@ode_sys, range, initial_conditions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% General constants obtained from Section 3.1 | |
mu_X_max = 0, 275 | |
K_XS = 0.0624 | |
K_iXS = 12.40 | |
K_XN = 0.0812 | |
K_iXN = 0.6250 | |
K_I = 45.50 | |
K_iI = 297.75 | |
A_0X = 0.6175 | |
E_aX = 25.9243 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Tuple | |
import numpy as np | |
import os | |
import pandas as pd | |
DATA_DIR = ... | |
data = pd.read_csv( | |
os.path.join(DATA_DIR, "ml-100k", "u.data"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Yelp review processor. | |
The module clusters Yelp features based on their sentence similarities. | |
This module takes a set of reviews as inputs, then generates two files: | |
- items.csv - item and their properties. | |
- extractions.csv - features and sentiments mined from item reviews. | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ratings_df = load_data(ML100K, implicit=IMPLICIT, n_users=NUM_USERS) | |
train_df, test_df = train_test_split(ratings_df, loo=True) | |
sampler = NegativeSampler(ratings_df['item_id'].unique()).fit(train=train_df, test=test_df) | |
train_df = sampler.transform(train_df, train=True, size=50) | |
test_df = sampler.transform(test_df, train=False, size=10) | |
gmf = GMF(n_users=ratings_df.user_id.nunique(), n_items=ratings_df.item_id.nunique(), implicit=IMPLICIT) | |
reco = Recommender(keras_model=gmf, loss='binary_crossentropy', optimizer='adam', ) | |
reco.fit(data=train_df, verbose=True, epochs=10) |
NewerOlder