Skip to content

Commit

Permalink
Revert "Network compression"
Browse files Browse the repository at this point in the history
  • Loading branch information
nicohiggs committed Jun 5, 2018
1 parent 04ca627 commit 45d2d0d
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 277 deletions.
2 changes: 1 addition & 1 deletion deepplantphenomics/__init__.py
Expand Up @@ -5,4 +5,4 @@

from .deepplantpheno import *
from .tools import *
from .networks import *
from .networks import *
279 changes: 91 additions & 188 deletions deepplantphenomics/deepplantpheno.py

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions deepplantphenomics/layers.py
Expand Up @@ -165,7 +165,6 @@ def add_to_graph(self):
if self.__initializer == 'xavier':
self.weights = tf.get_variable(self.name + '_weights', shape=[vec_size, self.output_size],
initializer=tf.contrib.layers.xavier_initializer())

else:
self.weights = tf.get_variable(self.name + '_weights',
shape=[vec_size, self.output_size],
Expand Down Expand Up @@ -230,10 +229,6 @@ def forward_pass(self, x, deterministic):
else:
return tf.nn.dropout(x, self.p)

def set_p(self, p):
print("dropout: %f -> %f" % (self.p, p))
self.p = p


class moderationLayer(object):
"""Layer for fusing moderating data into the input vector"""
Expand Down
6 changes: 3 additions & 3 deletions deepplantphenomics/loaders.py
Expand Up @@ -10,10 +10,10 @@ def split_raw_data(images, labels, ratio, moderation_features=None, augmentation
if isinstance(labels, list):
if split_labels:
labels = [' '.join(map(str, label)) for label in labels]
total_samples = len(labels)
else:
total_samples = labels.get_shape().as_list()[0]
#else:
#total_samples = labels.get_shape().as_list()[0]

total_samples = len(labels)


# calculate and perform random split
Expand Down
2 changes: 1 addition & 1 deletion deepplantphenomics/tools.py
@@ -1,4 +1,4 @@
from deepplantphenomics import networks
from . import networks
import numpy as np
import cv2

Expand Down
72 changes: 0 additions & 72 deletions docs/Compression.md

This file was deleted.

4 changes: 1 addition & 3 deletions examples/arabidopsis_strain_classifier_test.py
@@ -1,5 +1,3 @@
from __future__ import print_function

#
# Demonstrates the use of tools.classify_arabidopsis_strain on images of rosettes.
# Loads filenames from the IPPN dataset by default.
Expand All @@ -21,6 +19,6 @@
y = dpp.tools.classify_arabidopsis_strain(images)

for k,v in zip(images, y):
print('%s: %s' % (os.path.basename(k), v))
print '%s: %s' % (os.path.basename(k), v)

print('Done')
4 changes: 1 addition & 3 deletions examples/rosette_leaf_count_test.py
@@ -1,5 +1,3 @@
from __future__ import print_function

#
# Demonstrates the use of tools.predict_rosette_leaf_count on images of rosettes.
# Loads filenames from the IPPN dataset by default.
Expand All @@ -23,4 +21,4 @@
for k,v in zip(images, y):
print('%s: %d' % (os.path.basename(k), v))

print('Done')
print('Done')
1 change: 0 additions & 1 deletion mkdocs.yml
Expand Up @@ -10,7 +10,6 @@ pages:
- Model Options: Model-Options.md
- Data Fusion Options: Data-Fusion-Options.md
- Semantic Segmentation: Semantic-Segmentation.md
- Compression: Compression.md
- Tools: Tools.md
- Hyperparameter Optimization: Hyperparameter-Optimization.md
- Tutorials:
Expand Down

0 comments on commit 45d2d0d

Please sign in to comment.