Skip to content

Commit b3a183a

Browse files
author
Mridul Jain
committed
partial python changes for draw net
1 parent 6ba8a19 commit b3a183a

6 files changed

Lines changed: 71 additions & 43 deletions

File tree

‎caffe-grid/src/main/python/DisplayUtils.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from IPython.display import HTML
44
import numpy as np
55
from base64 import b64encode
6+
from draw_net import parse_args
7+
68
def get_np_array(row):
79
return np.frombuffer(row.data, 'uint8').reshape((row.height,row.width))
810

@@ -24,3 +26,10 @@ def show_df(df, nrows=10):
2426
html += "</tr>"
2527
html += "</table>"
2628
return HTML(html)
29+
30+
def show_network(input_net_proto_file, output_image_file):
31+
args = parse_args()
32+
net = caffe_pb2.NetParameter()
33+
text_format.Merge(open(args.input_net_proto_file).read(), net)
34+
print('Drawing net to %s' % args.output_image_file)
35+
caffe.draw.draw_net_to_file(net, args.output_image_file, args.rankdir)

‎caffe-grid/src/main/python/examples/DLDemo.ipynb‎

Lines changed: 57 additions & 38 deletions
Large diffs are not rendered by default.

‎caffe-grid/src/main/python/examples/MultiClassLogisticRegression.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def grouper(iterable, n, fillvalue=None):
2121
return izip_longest(fillvalue=fillvalue, *args)
2222

2323
conf = SparkConf()
24-
sc = SparkContext(conf)
24+
sc = SparkContext(conf=conf)
2525
sqlContext = SQLContext(sc)
2626
#Initialize all objects
2727
cos=CaffeOnSpark(sc,sqlContext)

‎data/lenet_dataframe_solver.prototxt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ max_iter: 10000
2020
snapshot: 5000
2121
snapshot_prefix: "mnist_lenet"
2222
# solver mode: CPU or GPU
23-
solver_mode: CPU
23+
solver_mode: GPU

‎data/lenet_dataframe_train_test.prototxt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ layer {
99
}
1010
source_class: "com.yahoo.ml.caffe.ImageDataFrame"
1111
memory_data_param {
12-
source: "/Users/mridul/bigml/mnist_train_dataframe/"
12+
source: "hdfs:///projects/machine_learning/image_dataset/mnist_train_dataframe/"
1313
batch_size: 64
1414
channels: 1
1515
height: 28
@@ -30,7 +30,7 @@ layer {
3030
}
3131
source_class: "com.yahoo.ml.caffe.ImageDataFrame"
3232
memory_data_param {
33-
source: "/Users/mridul/bigml/mnist_test_dataframe/"
33+
source: "hdfs:///projects/machine_learning/image_dataset/mnist_test_dataframe/"
3434
batch_size: 100
3535
channels: 1
3636
height: 28

‎python_doc/index.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to CaffeOnSparkPythonApi's documentation!
6+
Welcome to CaffeOnSpark Python API documentation!
77
=================================================
88

99
Contents:

0 commit comments

Comments
 (0)