This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create simple model | |
model = Sequential() | |
model.add(TimeDistributed(Convolution2D(32, 3, 3, border_mode='same'), input_shape = batch_input_shape[1:])) | |
model.add(Activation('relu')) | |
model.add(TimeDistributed(MaxPooling2D(pool_size = (2,2)))) | |
model.add(BatchNormalization()) | |
model.add(TimeDistributed(Convolution2D(32, 3, 3, border_mode='same'))) | |
model.add(Activation('relu')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ValueError Traceback (most recent call last) | |
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py in merge_with(self, other) | |
562 try: | |
--> 563 self.assert_same_rank(other) | |
564 new_dims = [] | |
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py in assert_same_rank(self, other) | |
608 raise ValueError( | |
--> 609 "Shapes %s and %s must have the same rank" % (self, other)) | |
610 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% ------------------------------------------------------------------------- | |
% ( 9 ) Inference & missing values | |
% ------------------------------------------------------------------------- | |
% Create inference engine | |
engine = jtree_inf_engine ( bnet ); | |
% Sort brokenData to right order | |
brokenDataSorted = brokenData ( bnet.ordering, : )'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline unsigned calcStates () { | |
unsigned numStates = (unsigned) substrings[0].size() + 1; | |
Word str1, str2; | |
for ( vector<Word>::iterator str = substrings.begin(); (str+1) != substrings.end(); ) { | |
str1 = *str; | |
str2 = *(++str); | |
unsigned i = 0; | |
while (str1[i] == str2[i] && i < str1.size()) i++; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function montage(images, varargin) | |
%MONTAGE Display multiple images as grid | |
% | |
% Synopsis: | |
% MYMONTAGE(images) | |
% MYMONTAGE(...,PARAM1,VAL1,PARAM2,VAL2,...) displays the image, specifying | |
% parameters and corresponding values that control various aspects of the | |
% image display. Parameter names can be abbreviated, and case does not matter. | |
% | |
% Parameters include: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIColor+HashParser.h | |
// | |
// Created by Vojtech Micka on 11/19/12. | |
// Copyright (c) 2012 All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIColor (HexParser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ model ] = perceptron( data, options ) | |
%PERCEPTRON | |
% | |
% INPUT: | |
% data : struct [ 1xn ] data for training the classifier | |
% .X | |
% .y | |
% limit : int [ 1x1 ] maximum number of iteration | |
% options : struc [ --- ] | |
% .limit : int [ 1x1 ] maximum number of iteration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
covGen = (0.5:0.001:2.5) * 10e2; | |
for s=1:size(covGen,2), | |
L(s) = sum(log(normpdf(measurmentX1, Model.Mean, covGen(s)))); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function y = my_parzen(x, X, sigma, method) | |
if ( ~exist('method', 'var') ), | |
method = 'method'; | |
end; | |
n = length(X); | |
y = zeros(length(x), 1); | |
switch method |
NewerOlder