Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1kaiser patch 1 #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/capsules/nets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import tensorflow as tf

from core import _conv2d_wrapper, capsules_init, capsules_conv, capsules_fc
from capsules.core import _conv2d_wrapper, capsules_init, capsules_conv, capsules_fc

slim = tf.contrib.slim

Expand All @@ -26,6 +26,10 @@ def capsules_v0(inputs, num_classes, iterations, name='CapsuleEM-V0'):
nets, shape=[1, 1, 32, 32], strides=[1, 1, 1, 1], padding='VALID', pose_shape=[4, 4], name='capsule_init'
)
# inputs: (poses, activations) -> capsule-conv 3x3x32x32x4x4, strides 2 -> (poses, activations)
nets = capsules_conv(
nets, shape=[3, 3, 32, 32], strides=[1, 3, 3, 1], iterations=iterations, name='capsule_conv0'
)

nets = capsules_conv(
nets, shape=[3, 3, 32, 32], strides=[1, 2, 2, 1], iterations=iterations, name='capsule_conv1'
)
Expand Down
2 changes: 1 addition & 1 deletion src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from __future__ import division
from __future__ import print_function

import capsules
from capsules import __init__

import tensorflow as tf

Expand Down
2 changes: 1 addition & 1 deletion src/train.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A train script for matrix capsule with EM routing."""

from settings import *
from . import settings

def main(_):

Expand Down