<jupyter_start><jupyter_text>`leftright` experimentThis notebook loads weights into a network just like the normal two-stream graph one, but with only one combined regressor output for left and right arms.<jupyter_code>from keras.optimizers import SGD

import numpy as np

import models
from vggnet.upgrade_weights import upgrade_weights
from vggnet.vgg16_keras import VGG_16

models = reload(models)
solver = SGD()
rgb_shape = (6, 224, 224)
flow_shape = (2, 224, 224)
regressor_outputs = 6
init = 'glorot_normal'
huge = models.vggnet16_joint_reg_class_flow_leftright({
    'images': (6, 224, 224),
    'flow': (2, 224, 224),
    'leftright': (16,),
    'head': (16,),
    'class': (4,)
}, solver, init)
flow_seq = huge.nodes['flow_conv']
rgb_seq = huge.nodes['rgb_conv']
ilsvrc_weights_path = './vggnet/vgg16_weights.h5'
ilsvrc_model = VGG_16(ilsvrc_weights_path)
upgrade_weights(flow_seq.layers, ilsvrc_model.layers)
upgrade_weights(rgb_seq.layers, ilsvrc_model.layers)
front_layers = len(flow_seq.layers)
back_ilsvrc_layers = ilsvrc_model.layers[front_layers:]
back_seq = huge.nodes['shared_layers']
upgrade_weights(back_seq.layers, back_ilsvrc_layers)
huge.save_weights('vggnet/vgg16-2stream-3pose-lr-reg-clas.h5')<jupyter_output>Using gpu device 1: Tesla K80 (CNMeM is enabled)
/home/sam/repos/joint-regressor/keras/env/local/lib/python2.7/site-packages/theano/tensor/signal/downsample.py:5: UserWarning: downsample module has been moved to the pool module.
  warnings.warn("downsample module has been moved to the pool module.")
{'fraction_non_alphanumeric': 0.11342894393741851, 'fraction_numerical': 0.03650586701434159, 'mean_word_length': 6.106481481481482, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '179562', 'license': 'Apache-2.0', 'n_tokens_mistral': 602, 'n_tokens_neox': 547, 'n_words': 127, 'path': 'keras/flow-rgb-graph-leftright-net-surgery.ipynb', 'repo_name': 'qxcv/joint-regressor', 'size': '1534'}