Create the latent tower.
516155
def construct_latent_tower(self, images, time_axis):
    """"""
    # No latent in the first phase
    first_phase = tf.less(
        self.get_iteration_num(), self.hparams.num_iterations_1st_stage)

    # use all frames by default but this allows more
    # predicted frames at inference time
    latent_num_frames = self.hparams.latent_num_frames
    tf.logging.info("Creating latent tower with %d frames." % latent_num_frames)
    if latent_num_frames > 0:
      images = images[:, :latent_num_frames]

    return common_video.conv_latent_tower(
        images=images,
        time_axis=time_axis,
        latent_channels=self.hparams.latent_channels,
        min_logvar=self.hparams.latent_std_min,
        is_training=self.is_training,
        random_latent=first_phase,
        tiny_mode=self.hparams.tiny_mode,
        small_mode=self.hparams.small_mode)
1353958
def _create_latent_variables(self):
        

        self.latent_variables.add_z('Sigma^2 irregular', fam.Flat(transform='exp'), fam.Normal(0,3))

        self.latent_variables.add_z('Constant', fam.Flat(transform=None), fam.Normal(0,3))

        for parm in range(1,self.ar+1):
            self.latent_variables.add_z('Sigma^2 AR(' + str(parm) + ')', fam.Flat(transform='exp'), fam.Normal(0,3))
518277
def build(self):
        """"""

        assert not self.final, 'Trying to mutate a final graph.'

        # Replace each strongly connected component with a single node `NodeSet`
        for scc in sorted(nx.kosaraju_strongly_connected_components(self.graph),
                          key=len, reverse=True):
            if len(scc) == 1:
                break

            self.shrink_to_node(NodeSet(scc))

        self.final = True
840632
async def build(self, building: UnitTypeId, near: Union[Point2, Point3], max_distance: int=20, unit: Optional[Unit]=None, random_alternative: bool=True, placement_step: int=2):
        """"""

        if isinstance(near, Unit):
            near = near.position.to2
        elif near is not None:
            near = near.to2
        else:
            return

        p = await self.find_placement(building, near.rounded, max_distance, random_alternative, placement_step)
        if p is None:
            return ActionResult.CantFindPlacementLocation

        unit = unit or self.select_build_worker(p)
        if unit is None or not self.can_afford(building):
            return ActionResult.Error
        return await self.do(unit.build(building, p))
96745
def build(self, input_path, output_paths):
        """"""
        for output in output_paths:
            shutil.copy(input_path, output_paths)
1276407
def _spawn_new(self, count=1):
        """"""
        free = self.free_cells()
        for x, y in random.sample(free, min(count, len(free))):
            self.grid[y][x] = random.randint(0, 10) and 2 or 4
231219
def buildcontent(self):
        """"""

        self.buildcontainer()
        self.option = json.dumps(self.options, cls = HighchartsEncoder)
        self.setoption = json.dumps(self.setOptions, cls = HighchartsEncoder) 
        self.data = json.dumps(self.data_temp, cls = HighchartsEncoder)

        # DEM 2017/04/25: Make 'data' available as an array
        # ... this permits jinja2 array access to each data definition
        # ... which is useful for looping over multiple data sources
        self.data_list = [json.dumps(x, cls = HighchartsEncoder) for x in self.data_temp]
        
        if self.navi_seri_flag:        
            self.navi_seri = json.dumps(self.navi_seri_temp, cls = HighchartsEncoder)

        self._htmlcontent = self.template_content_highcharts.render(chart=self).encode('utf-8')
946452
def create(self):
        """"""
        # url('datastores')
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        content = content.decode('utf8')
        content = simplejson.loads(content)
        new = DataStore(content['name'],
                        content['type'],
                        content['ogrstring'])
        results = meta.Session.add(new)
        meta.Session.commit()
        response.status = 201
119311
def create(self):
        
        steps = [
            (self.create_role, (), {}),
            (self.create_vpc, (), {}),
            (self.create_cluster, (), {}),
            (self.create_node_group, (), {}),
            (self.create_spot_nodes, (), {}),
            (self.create_utilities, (), {}),
        ]
        # Execute creation.
        for step in tqdm.tqdm(steps, ncols=70):
            method, args, kwargs = step
            method(*args, **kwargs)
571691
def create_frame(self):
        
        frame = Gtk.Frame()
        frame.set_shadow_type(Gtk.ShadowType.IN)
        return frame
308497
def _build(self, input_shape, dtype=tf.float32):
    
    with tf.variable_scope(self.name, reuse=tf.AUTO_REUSE):
      nonZeros = int(round(input_shape[-1].value * self.sparsity))

      # Create random mask with k elements set to 1, all other elements set to 0
      values = tf.random_uniform(input_shape)
      topk, _ = tf.math.top_k(input=values, k=nonZeros, sorted=False)
      kth = tf.reduce_min(topk, axis=1, keepdims=True)
      mask = tf.cast(tf.greater_equal(values, kth), dtype=dtype)
      self.mask = tf.get_variable(self.name, initializer=mask, trainable=False,
                                  synchronization=tf.VariableSynchronization.NONE)
      keras.backend.track_variable(self.mask)
      self._built = True
1118589
function() {
        this.blocks = [];

        //since all positions contain the same number of blocks, we can 
        // just pick the first position and use its blocks array to create
        // our blocks array
        var firstPosition = null;
        for(var key in this.positionBlocks) {
            firstPosition = key;
            break;
        }
        
        var position = this.positionBlocks[firstPosition];
        for (var i = 0; i < position.blocks.length; i++) {

            var block = {};
            this.blocks.push(block);

            var divId = this.id + '_FrameDecorationDiv_' + i;
            block.div = OpenLayers.Util.createDiv(divId, 
                null, null, null, "absolute", null, "hidden", null
            );

            var imgId = this.id + '_FrameDecorationImg_' + i;
            var imageCreator = 
                (this.isAlphaImage) ? OpenLayers.Util.createAlphaImageDiv
                                    : OpenLayers.Util.createImage;

            block.image = imageCreator(imgId, 
                null, this.imageSize, this.imageSrc, 
                "absolute", null, null, null
            );

            block.div.appendChild(block.image);
            this.groupDiv.appendChild(block.div);
        }
    }
350476
def build(self, dest=None):
        ""
        # dest can be set here or on init
        if not dest:
            dest = self.dest

        # raise an error if dest is None
        if dest is None:
            raise ValueError('destination directory must not be None')

        # store build dir for later
        self.dest = dest

        # ensure a build dir
        if not os.path.isdir(self.dest):
            os.makedirs(self.dest)

        # make sure we have files
        if not self.files:
            self.run()

        # write the content of each post to dest, using keys as filenames
        for filename, post in self.files.items():

            # join filename to dest dir
            path = os.path.join(self.dest, filename)
            with open(path, 'wb') as f:
                f.write(post.content.encode('utf-8'))
1107720
private void setUp(Random rand)
    {
        Ws = new ArrayList<>(npl.length);
        bs = new ArrayList<>(npl.length);
        
        //First Hiden layer takes input raw
        DenseMatrix W = new DenseMatrix(npl[0], inputSize);
        Vec b = new DenseVector(W.rows());
        initializeWeights(W, rand);
        initializeWeights(b, W.cols(), rand);
        Ws.add(W);
        bs.add(b);
        
        //Other Hiden Layers Layers 
        for(int i = 1; i < npl.length; i++)
        {
            W = new DenseMatrix(npl[i], npl[i-1]);
            b = new DenseVector(W.rows());
            initializeWeights(W, rand);
            initializeWeights(b, W.cols(), rand);
            Ws.add(W);
            bs.add(b);
        }
        
        //Output layer
        W = new DenseMatrix(outputSize, npl[npl.length-1]);
        b = new DenseVector(W.rows());
        initializeWeights(W, rand);
        initializeWeights(b, W.cols(), rand);
        Ws.add(W);
        bs.add(b);
        
    }
922374
def build(self, builder):
        """"""
        params = {}
        if self.study_oid:
            params.update(dict(StudyOID=self.study_oid))
        builder.start("AdminData", params)
        for user in self.users:
            user.build(builder)
        for location in self.locations:
            location.build(builder)

        builder.end("AdminData")
603523
def create(self):
        """"""
        required_nodes = self._get_required_nodes()
        self.lb_attrs = self.consul.create_lb(
                self.instance_name,
                protocol=self.protocol,
                port=self.port,
                nodes=required_nodes,
                node_port=str(self.backend_port),
                algorithm=getattr(self, 'algorithm', None)
                )
439552
def create(self):
        """"""
        self.idx_chan = QComboBox()
        self.idx_chan.activated.connect(self.display_window)

        self.idx_fig = QGraphicsView(self)
        self.idx_fig.scale(1, -1)

        layout = QVBoxLayout()
        layout.addWidget(self.idx_chan)
        layout.addWidget(self.idx_fig)
        self.setLayout(layout)

        self.resizeEvent(None)