Comments (6)
A highlight is why the reshaped tensor have different shape?
see test_reshape_gpu
Then, other test failure should be due to very small numerical errors (order of 1e-5) that can be fixed by reducing the number of significant in comparison.
from singa.
should we make travis build fail when encountering errors raised from python unit test?
from singa.
should we make travis build fail when encountering errors raised from python unit test?
In my opinion, this is a very good feature. However, I am not sure if the machine that runs the test case by travis has GPU.
On the other hand, this test_operation.py is still important because it lets the developers to check whether the system has any problem after their commits.
from singa.
If I am correct, the reshape is due to the error in backward:
class Reshape(Operation):
def __init__(self,shape):
super(Reshape, self).__init__()
if isinstance(shape, tensor.Tensor):
self.shape = np.asarray(tensor.to_numpy(shape).astype(np.int32)).tolist()
else:
self.shape = list(shape)
def forward(self, x):
_shape = x.shape()
shape = self.shape
# handle the shape with 0
shape = [_shape[i] if i < len(_shape) and shape[i] == 0 else shape[i] for i in range(len(shape))]
# handle the shape with -1
hidden_shape = int(np.prod(_shape) // np.abs(np.prod(shape)))
self.cache=[s if s != -1 else hidden_shape for s in shape]
return singa.Reshape(x, self.cache)
def backward(self, dy):
return singa.Reshape(dy, self.cache)
I think the function should change to
class Reshape(Operation):
def __init__(self,shape):
super(Reshape, self).__init__()
if isinstance(shape, tensor.Tensor):
self.shape = np.asarray(tensor.to_numpy(shape).astype(np.int32)).tolist()
else:
self.shape = list(shape)
def forward(self, x):
self._shape = x.shape()
shape = self.shape
# handle the shape with 0
shape = [self._shape[i] if i < len(self._shape) and shape[i] == 0 else shape[i] for i in range(len(shape))]
# handle the shape with -1
hidden_shape = int(np.prod(self._shape) // np.abs(np.prod(shape)))
self.cache=[s if s != -1 else hidden_shape for s in shape]
return singa.Reshape(x, self.cache)
def backward(self, dy):
return singa.Reshape(dy, self._shape)
from singa.
To resolve the problem completely, I opened a hotfix at PR #579
from singa.
the problem is resolved completely
from singa.
Related Issues (20)
- Switch between CPU and GPU devices for cnn example HOT 4
- Save the downloaded datasets to local directory HOT 2
- Add running scripts for cnn and cifar_distributed_cnn examples HOT 4
- Intermediate information printing HOT 3
- Adding arguments for weight decay and momentum HOT 2
- Increase max epoch for cnn example for better convergence HOT 2
- Update CMakeLists.txt for release 4.0.0 HOT 1
- Check Apache license header for release 4.0.0
- OpenCL Compilation Fails
- Upload Release 4.0.0 Package to SVN HOT 1
- Update the NOTICE file for images HOT 1
- gitignore and gitmodules should be removed from the release tar file HOT 2
- Create a new branch dev-postgresql HOT 2
- Create the SumError New Loss Function HOT 1
- Dynamic Creation of Models HOT 2
- Need to return the gradients from optimizer HOT 4
- Maximum recursion depth exceeded in comparison for string HOT 1
- can sparse all-reduce keep efficiency with large number of gpu workers?
- Update bloodmnist example by refining inline comments HOT 2
- Update documentation for distributed training HOT 1
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 singa.