mirror of
https://github.com/wassname/CoordConv.git
synced 2026-09-10 11:40:52 +08:00
add quadrant dataset predictions plot
This commit is contained in:
+30
-28
File diff suppressed because one or more lines are too long
@@ -1,18 +1,22 @@
|
||||
# CoordConv
|
||||
|
||||
 
|
||||
|
||||
Pytorch implementation of CoordConv for N-D ConvLayers, and the experiments.
|
||||
|
||||
Reference from the paper "An intriguing failing of convolutional neural networks and the CoordConv solution."
|
||||
Reference from the paper: [An intriguing failing of convolutional neural networks and the CoordConv solution](https://arxiv.org/abs/1807.03247)
|
||||
|
||||
Extends the CoordinateChannel concatenation from 2D to 1D and 3D tensors.
|
||||
|
||||
# Requirements
|
||||
|
||||
- pytorch 0.4.0
|
||||
- torchvision 0.2.1
|
||||
- torchsummary 1.3
|
||||
- sklearn 0.19.1
|
||||
|
||||
# Usage
|
||||
|
||||
```python
|
||||
from coordconv import CoordConv1d, CoordConv2d, CoordConv3d
|
||||
|
||||
@@ -39,17 +43,24 @@ net = Net().to(device)
|
||||
```
|
||||
|
||||
# Experiments
|
||||
|
||||
Implement experiments from origin paper.
|
||||
|
||||
## Coordinate Classification
|
||||
|
||||
Use `experiments/generate_data.py` to generate `Uniform` and `Quadrant` datasets for Coordinate Classification task.
|
||||
|
||||
Use `experiments/train_and_test.py` to train and test neural network model.
|
||||
|
||||
### Images
|
||||
### Uniform Datasets
|
||||
|
||||
|Train|Test|Predictions|
|
||||
|:---:|:---:|:---:|
|
||||
||||
|
||||
|
||||
|
||||
### Quadrant Datasets
|
||||
|
||||
|Train|Test|Predictions|
|
||||
|:---:|:---:|:---:|
|
||||
||||
|
||||
@@ -67,8 +67,8 @@ else:
|
||||
train_set = np.array(train_set)
|
||||
test_set = np.array(test_set)
|
||||
|
||||
train_set = train_set[:, None, None, :]
|
||||
test_set = test_set[:, None, None, :]
|
||||
train_set = train_set[:, :, None, None]
|
||||
test_set = test_set[:, :, None, None]
|
||||
|
||||
print(train_set.shape)
|
||||
print(test_set.shape)
|
||||
@@ -87,4 +87,4 @@ else:
|
||||
np.save('data-quadrant/train_onehot.npy', train_onehot)
|
||||
np.save('data-quadrant/train_images.npy', train_images)
|
||||
np.save('data-quadrant/test_onehot.npy', test_onehot)
|
||||
np.save('data-quadrant/test_images.npy', test_images)
|
||||
np.save('data-quadrant/test_images.npy', test_images)
|
||||
|
||||
Reference in New Issue
Block a user