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

Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

Luettelo Yhdysvaltain laivaston lentotukialuksista Lähteet | Navigointivalikko

Gary (muusikko) Sisällysluettelo Historia | Rockin' High | Lähteet | Aiheesta muualla | NavigointivalikkoInfobox OKTuomas "Gary" Keskinen Ancaran kitaristiksiProjekti Rockin' High