Comments (2)
Same exception on Ubuntu 18.04 with Python 3.6.9 & PyTorch 1.3.1
from pylissom.
The issue is in pylissom.math.normalize:
def normalize(matrix, norm=1, axis=1):
"""
This function implements a normalization of the row or column vectors of a matrix
(by default, normalizes the columns and uses norm 1).
Args:
matrix: input matrix
norm: Dimension of the norm
axis: 0 is column, 1 is row
Returns:
A matrix normalized by columns or rows
"""
matrix_norms = matrix.norm(p=norm, dim=axis)
return matrix.div(matrix_norms.expand_as(matrix))
I'm not 100% sure I understand the intended behaviour, but making the following change:
matrix_norms = matrix.norm(p=norm, dim=axis).reshape(-1 if axis==1 else 1,1 if axis==1 else -1)
to add a singleton dimension, seems to result in the function dividing each element by its row or col norm.
(possibly a more elegant way to implement it)
That fixes the exception on instantiation of Cortex. However, the UserWarning mentioned is still present.
from pylissom.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylissom.