jinze1994 / atrank Goto Github PK
View Code? Open in Web Editor NEWAn Attention-Based User Behavior Modeling Framework for Recommendation
License: Apache License 2.0
An Attention-Based User Behavior Modeling Framework for Recommendation
License: Apache License 2.0
Line 146 in 2031fd1
This line input is hist_i_emb, which length is various from different data. You input this tensor into a Dense layer. The Dense layer need a fix-length input. I don't understand here.
It's said that the heterogeneous behavior code is available for review, however I didn't find any. Please point out, thank you @jinze1994
Traceback (most recent call last):
File "train.py", line 184, in
tf.app.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "train.py", line 181, in main
train()
File "train.py", line 132, in train
model = create_model(sess, config, cate_list)
File "train.py", line 54, in create_model
print(json.dumps(config, indent=4), flush=True)
File "/usr/lib/python3.6/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python3.6/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/usr/lib/python3.6/json/encoder.py", line 430, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/usr/lib/python3.6/json/encoder.py", line 404, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.6/json/encoder.py", line 437, in _iterencode
o = _default(o)
File "/usr/lib/python3.6/json/encoder.py", line 180, in default
o.class.name)
TypeError: Object of type 'HelpFlag' is not JSON serializable
In the code /ATRank/utils/2_remap_id_raw.py, asin(item) ids are remapped to 0 ~ item_count.
In the code /ATRank/atrank/input.py, hist_i is padding with value of 0. So I guess there are two kinds of 0 in the hist_i matrix: one is real asin id 0 and the other is padding value 0.
When using tf.nn.embedding_lookup with hist_i to generate h_emb in the code /ATRank/atrank/model.py, will you fill h_emb with a lot of real item 0's vectors which do not exist in the purchase history?
Do I miss anything in your code or misunderstand any part of it?
Could you offer me a public dataset? maybe a data pattern,I can follow your way to run my experiment。I don`t know what the data should look like. Thank u.
It seems that you atrank is different from the one described in paper. For example, bilinear attention is used in paper, but scale-dot attention here. Vanilla attention in paper, but multi-head attention here.
it seems that you atrank is different from the one described in paper.
for _, uij in MyDataInputTest(test_set, FLAGS.test_batch_size):
auc_sum += model.eval(sess, uij) * len(uij[0])
test_auc = auc_sum / len(test_set)
I run the atrank network on my own dataset. I use the top command and find that the code consumes high cpu usage(1500%). I'm sure the network causes that because if I remove the network, it's normal.And I'm sure the network is running on Gpu. And if i use "session_conf = tf.ConfigProto( intra_op_parallelism_threads=1, inter_op_parallelism_threads=1)" to limit the number of CPUs that tensorflow can use, the usage of cpu will not be high but the speed is very slow .So is there some ops in atrank consuming cpu? When you run the code, is there a high cpu usage?
hi,dear
大佬,1.14或者1.15的版本能用吗?
运行rnn、rnn_att、bpr模型时,在
def train(self, sess, uij, l):
103 loss, _ = sess.run([self.loss, self.train_op], feed_dict={
104 self.u: uij[0],
105 self.i: uij[1],
106 self.y: uij[2],
107 self.hist_i: uij[3],
108 self.sl: uij[4],
109 self.lr: l,
110 })
111 return loss
def train(self, sess, uij, l):
113 loss, _ = sess.run([self.loss, self.train_op], feed_dict={
114 self.u: uij[0],
115 self.i: uij[1],
116 self.y: uij[2],
117 self.hist_i: uij[2],
118 self.sl: uij[4],
119 self.lr: l,
120 })
121 return loss
都遇到了这个问题,希望作者能够更新代码解决这个问题。
In multi/model.py, it seems we can only use one type behavior train the model. But in your paper, you concat different type of feature from different bg. How can I use different type behaviors at the same time?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.