Kronecker product using sparse matrices / tensors in tensorflowTensorflow neural network TypeError: Fetch argument has invalid typeTesting a tensorflow network: in_top_k() replacement for multilabel classificationPyTorch vs. Tensorflow FoldFine-tuning a model from an existing checkpoint with TensorFlow-SlimMNIST Deep Neural Network using TensorFlowLSTM Implementation using tensorflow (anaconda)Improve test accuracy for TensorFlow CNNHow does one interpret output from hyper-engine while optimizing a single hyperparameter of a neural network?Neural network model for sparse multi-class classifier on TensorflowUsing Keras masking layer with 2D convolutions (Conv2D)

Identifying the interval from A♭ to D♯

Can I get a Visa Waiver after spending 6 months in USA with B-2 Visa?

PTIJ: Who should I vote for? (21st Knesset Edition)

Welcoming 2019 Pi day: How to draw the letter π?

Declaring defaulted assignment operator as constexpr: which compiler is right?

How to write cleanly even if my character uses expletive language?

Better performance for geohash aggregation with PostGIS

How do anti-virus programs start at Windows boot?

Employee lack of ownership

Backup with Hanoi Strategy

Create shipment and invoice in mass action

What does it mean to make a bootable LiveUSB?

Software described as 香ばしい

What are substitutions for coconut in curry?

Brexit - No Deal Rejection

Recruiter wants very extensive technical details about all of my previous work

Happy pi day, everyone!

shell script to pass values properties file in java

newcommand: Combine (optional) star and optional parameter

Why do Australian milk farmers need to protest supermarkets' milk price?

How to prevent Firefox and Chrome from opening ports in the firewall?

Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?

At what level can a dragon innately cast its spells?

How to deal with a cynical class?



Kronecker product using sparse matrices / tensors in tensorflow


Tensorflow neural network TypeError: Fetch argument has invalid typeTesting a tensorflow network: in_top_k() replacement for multilabel classificationPyTorch vs. Tensorflow FoldFine-tuning a model from an existing checkpoint with TensorFlow-SlimMNIST Deep Neural Network using TensorFlowLSTM Implementation using tensorflow (anaconda)Improve test accuracy for TensorFlow CNNHow does one interpret output from hyper-engine while optimizing a single hyperparameter of a neural network?Neural network model for sparse multi-class classifier on TensorflowUsing Keras masking layer with 2D convolutions (Conv2D)













1












$begingroup$


I am currently trying to perform a kronecker product on a pair of sparse tensors in tensorflow. I have found some code on another thread to perform the kronecker product using normal tensors.



def tf_kron(a,b):
a_shape = [a.shape[0].value,a.shape[1].value]
b_shape = [b.shape[0].value,b.shape[1].value]
return tf.reshape(tf.reshape(a,[a_shape[0],1,a_shape[1],1])*tf.reshape(b,[1,b_shape[0],1,b_shape[1]]),[a_shape[0]*b_shape[0],a_shape[1]*b_shape[1]])


However this is not the case with sparse tensors. I'm not fully aware of how to reshape sparse tensors.










share|improve this question











$endgroup$











  • $begingroup$
    It would be helpful to be a bit more specific about your problem... What have you tried so far - or found elsewhere - that didn't help you?
    $endgroup$
    – n1k31t4
    yesterday






  • 1




    $begingroup$
    This is the code I have used on regular tensors.
    $endgroup$
    – DeepLearner
    yesterday















1












$begingroup$


I am currently trying to perform a kronecker product on a pair of sparse tensors in tensorflow. I have found some code on another thread to perform the kronecker product using normal tensors.



def tf_kron(a,b):
a_shape = [a.shape[0].value,a.shape[1].value]
b_shape = [b.shape[0].value,b.shape[1].value]
return tf.reshape(tf.reshape(a,[a_shape[0],1,a_shape[1],1])*tf.reshape(b,[1,b_shape[0],1,b_shape[1]]),[a_shape[0]*b_shape[0],a_shape[1]*b_shape[1]])


However this is not the case with sparse tensors. I'm not fully aware of how to reshape sparse tensors.










share|improve this question











$endgroup$











  • $begingroup$
    It would be helpful to be a bit more specific about your problem... What have you tried so far - or found elsewhere - that didn't help you?
    $endgroup$
    – n1k31t4
    yesterday






  • 1




    $begingroup$
    This is the code I have used on regular tensors.
    $endgroup$
    – DeepLearner
    yesterday













1












1








1





$begingroup$


I am currently trying to perform a kronecker product on a pair of sparse tensors in tensorflow. I have found some code on another thread to perform the kronecker product using normal tensors.



def tf_kron(a,b):
a_shape = [a.shape[0].value,a.shape[1].value]
b_shape = [b.shape[0].value,b.shape[1].value]
return tf.reshape(tf.reshape(a,[a_shape[0],1,a_shape[1],1])*tf.reshape(b,[1,b_shape[0],1,b_shape[1]]),[a_shape[0]*b_shape[0],a_shape[1]*b_shape[1]])


However this is not the case with sparse tensors. I'm not fully aware of how to reshape sparse tensors.










share|improve this question











$endgroup$




I am currently trying to perform a kronecker product on a pair of sparse tensors in tensorflow. I have found some code on another thread to perform the kronecker product using normal tensors.



def tf_kron(a,b):
a_shape = [a.shape[0].value,a.shape[1].value]
b_shape = [b.shape[0].value,b.shape[1].value]
return tf.reshape(tf.reshape(a,[a_shape[0],1,a_shape[1],1])*tf.reshape(b,[1,b_shape[0],1,b_shape[1]]),[a_shape[0]*b_shape[0],a_shape[1]*b_shape[1]])


However this is not the case with sparse tensors. I'm not fully aware of how to reshape sparse tensors.







python deep-learning tensorflow






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







DeepLearner

















asked yesterday









DeepLearnerDeepLearner

405




405











  • $begingroup$
    It would be helpful to be a bit more specific about your problem... What have you tried so far - or found elsewhere - that didn't help you?
    $endgroup$
    – n1k31t4
    yesterday






  • 1




    $begingroup$
    This is the code I have used on regular tensors.
    $endgroup$
    – DeepLearner
    yesterday
















  • $begingroup$
    It would be helpful to be a bit more specific about your problem... What have you tried so far - or found elsewhere - that didn't help you?
    $endgroup$
    – n1k31t4
    yesterday






  • 1




    $begingroup$
    This is the code I have used on regular tensors.
    $endgroup$
    – DeepLearner
    yesterday















$begingroup$
It would be helpful to be a bit more specific about your problem... What have you tried so far - or found elsewhere - that didn't help you?
$endgroup$
– n1k31t4
yesterday




$begingroup$
It would be helpful to be a bit more specific about your problem... What have you tried so far - or found elsewhere - that didn't help you?
$endgroup$
– n1k31t4
yesterday




1




1




$begingroup$
This is the code I have used on regular tensors.
$endgroup$
– DeepLearner
yesterday




$begingroup$
This is the code I have used on regular tensors.
$endgroup$
– DeepLearner
yesterday










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47286%2fkronecker-product-using-sparse-matrices-tensors-in-tensorflow%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Data Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47286%2fkronecker-product-using-sparse-matrices-tensors-in-tensorflow%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Marja Vauras Lähteet | Aiheesta muualla | NavigointivalikkoMarja Vauras Turun yliopiston tutkimusportaalissaInfobox OKSuomalaisen Tiedeakatemian varsinaiset jäsenetKasvatustieteiden tiedekunnan dekaanit ja muu johtoMarja VaurasKoulutusvienti on kestävyys- ja ketteryyslaji (2.5.2017)laajentamallaWorldCat Identities0000 0001 0855 9405n86069603utb201588738523620927

Which is better: GPT or RelGAN for text generation?2019 Community Moderator ElectionWhat is the difference between TextGAN and LM for text generation?GANs (generative adversarial networks) possible for text as well?Generator loss not decreasing- text to image synthesisChoosing a right algorithm for template-based text generationHow should I format input and output for text generation with LSTMsGumbel Softmax vs Vanilla Softmax for GAN trainingWhich neural network to choose for classification from text/speech?NLP text autoencoder that generates text in poetic meterWhat is the interpretation of the expectation notation in the GAN formulation?What is the difference between TextGAN and LM for text generation?How to prepare the data for text generation task

Is this part of the description of the Archfey warlock's Misty Escape feature redundant?When is entropic ward considered “used”?How does the reaction timing work for Wrath of the Storm? Can it potentially prevent the damage from the triggering attack?Does the Dark Arts Archlich warlock patrons's Arcane Invisibility activate every time you cast a level 1+ spell?When attacking while invisible, when exactly does invisibility break?Can I cast Hellish Rebuke on my turn?Do I have to “pre-cast” a reaction spell in order for it to be triggered?What happens if a Player Misty Escapes into an Invisible CreatureCan a reaction interrupt multiattack?Does the Fiend-patron warlock's Hurl Through Hell feature dispel effects that require the target to be on the same plane as the caster?What are you allowed to do while using the Warlock's Eldritch Master feature?