Monday, March 12, 2018

An essay in the techniques of innovation
I have explored some common themes for innovations in design as shown in the documents under references section. I would like to enumerate some that resonate with me a lot:
Simplicity – A jigsaw puzzle, a screw driver, a simpler user interface like Bose audio speak eloquently to their functionality by virtue of simplicity. Sometimes minimal design works well not only to highlight the purpose of the item but also to conserve what doesn’t need to be expressed.
Multi-functionality – Nothing delights a customer than offering value in terms of more than what was required from the product. A Swiss army knife is handy and sought after for this purpose. This is probably a direct opposite of the example cited above but it is as essential to design as the first one.  Japanese restrooms genuinely feel like a spaceship. Combining values into a product also delights customers.
Automation – Anything that improves convenience for a user and improves the experience is welcome to design ideas. This does not mean reducing the touchpoints with the customer but rewarding those that the customer likes and reducing the others that gets in the way or increases onus. A fidget spinner or a top is popular because it entices the player to try it again with minimal involvement.
Elegance – This comes from thinking through all the usages for the product and playing up the features that matter most in an aesthetic way. I borrow this idea from professionals who go above and beyond to realize a design. As an example, perhaps any stick would do for a door handle, but a rubbery grip would do more for the user if the door and the users remain the same.
The techniques for innovation must have a lot of textbooks and curated articles online. I found them to be exhaustive and these are merely those that I could apply.
References:
1. https://1drv.ms/w/s!Ashlm-Nw-wnWs130GlgiZX7PI1RR
2. https://1drv.ms/w/s!Ashlm-Nw-wnWsXwBts-27OY5yxqw
3. https://1drv.ms/w/s!Ashlm-Nw-wnWsXDw5eIxh5v_TSsQ
4. https://1drv.ms/w/s!Ashlm-Nw-wnWkTzXCEGrAysjDkzk

#codingexercise
Get the maximum contiguous product for short integer arrays
double maxProduct(List <int> A)
{
double max = Int_min;
if ( A == null || A.Count == 0)
    return max;
for (int I = 0; I  < A.Length ; i++)
{
   double product = A [i];
   max = Math.max (product, max);
   for ( int j = i +1; j < A.Length; j++)
   {
         product = product × A [j];
         max = Math.max (product, max);
   }
}
return max;
}

Sunday, March 11, 2018

#codingexercise
A step array is an array of integer where each element has a difference of atmost k with its neighbor. Given a key x, we need to find the index value of k if multiple element exist return the index of any  occurrence of key.
Input : arr[] = {4, 5, 6, 7, 6}
           k = 1
           x = 6
Output : 2


int GetIndex(List<int> A, int x, int k)
{
int i = 0;
while (i < A.Length)
{
if (A[i] == x)
   return i;
i = i + Math.Max(1, Math.Abs(A[i]-x)/k);
}
return -1;
}

Get the nth number of the Golomb sequence

int a (uint n)
{
if ( n == 0)
      return 0;
if  (n == 1) 
      return 1;
return 1 + a(n – a(a(n-1)));
}


Saturday, March 10, 2018

 Get Max product from an integer array
public int maxProduct(List<int> input)
{
int lo = 1;
int hi = 1;
int result = 1;
for (int i = 0; i < input.Count; i++)
{
if (input[i]  == 0)
{
lo = 1;
hi = 1;
}
else{
   int temp = hi * input[i];
   if (input[i] > 0)
   {
       hi = temp;
       lo = Math.Min(lo * input[i], 1);
   }
   else
   {
      lo = temp;
      hi = Math.Max(lo * input[i], 1);
   }
}
if (result < hi)
    result = hi;
}
return result;
}
This is for contiguous subsequence.
We could also write the above if else in dynamic programming with recursion to include either the current element or exclude it. If an element is not included we multiply 1. If it is included we multiply the element to the maximum  of the recursion found as for example in positive integer array
int getMaxProduct(List<int> A, int index)
{
assert (A.all (x=> x>=0));
if (index  == A.Length)
     return 1;
int remaining = GetMaxProduct (A, index +1);
return Math.max (A [index] * remaining,  1 * remaining) ;
}
which is the same as saying replace all 0 with 1 in the sorted positive integer array
Therefore we can even sort the integer array replace all 0 with 1 and trim the odd count negative number to the left of zero
double GetMaxProduct (List <int> A)
{
A.sort ();
A.replaceAll(0, 1);
int count = A.Count (x => x < 0);
if (count > 0 && count % 2 == 1)
{
    A.replace (A.min (x => x < 0), 1);
}
return A.Product ();
}

Friday, March 9, 2018

We were discussing Signature verification methods. We reviewed the stages involved with Signature verification. Then we also enumerated the feature extraction techniques. After that, we compared online and offline verification techniques. We also discussed the limitations of image processing and the adaptations for video processing.Then we proceeded to discussing image embedding in general.
We discussed Convolutional Neural Network (CNN) in image and object embedding in a shared space followed by shape signature and image retrieval.
The purpose of the embedding is to map an image to a point in the embedding space so that it is close to a point attributed to a 3D model of a similar object. A large amount of training data consisting of images synthesized from 3D shapes is used to train the CNN.
By using synthesized images, the embedding space is computed from clean 3D models without noise. This enables better object similarities. In addition 2D shape views are tossed in which boost the shape matching. This use of embedding space is a novel approach and enables a better domain for subsequent image and shape retrievals. Moreover the embedding space does away with linear classifiers. This yields robust comparision of real world images to 3D models. Previously, this was susceptible to image nuisance factors from real world images and the linear classifiers could not keep up. On the other hand the use of CNN mitigates this because it does better with image invariance learning  - a technique that focuses on the salient invariant embedded objects rather than noise.

#codingexercise
We covered a few probability distributions earlier - uniform, normal, exponential. Let us describe the Poisson distribution for x success in n trials with success probability p each:
double GetProbabilityXevents(double n, double x. double p)
{
Debug.Assert( n  >= 0 && x >= 0 && p >= 0);
return GetNChooseX(n,x)*Math.pow(p,x)*Math.pow((1-p), (n-x));
}

Thursday, March 8, 2018

We were discussing Signature verification methods. We reviewed the stages involved with Signature verification. Then we also enumerated the feature extraction techniques. After that, we compared online and offline verification techniques. We also discussed the limitations of image processing and the adaptations for video processing.Then we proceeded to discussing image embedding in general.
We discussed Convolutional Neural Network (CNN) in image and object embedding in a shared space. We followed this discussion with shape signature and image retrieval.
The purpose of the embedding is to map an image to a point in the embedding space so that it is close to a point attributed to a 3D model of a similar object. A large amount of training data consisting of images synthesized from 3D shapes is used to train the CNN.
We now discuss shape retrieval. The methods for shape retrieval mostly operate on input query in 3D domain.  However, CNN proposes a new way of searching both images and shapes by placing them in a shared embedding space. This sharing enables comparision between images and shapes easily since the shapes and images that are similar are co-located in the same neighborhood.
This is a very sought after discipline because it has appeal for many real world applications. Aubry et al proposed a part-based method that focuses on detecting image regions that match parts in 3D models.  A star model is then designed to combine discriminating patches for measuring the similarity. This is helpful for matching shapes from arbitrary images. However this method requires tuning that may change from domain to domain. Instead, the CNN network provides a uniform shared embedding space where image feature extraction is based on shape distance metric.

We discussed the use of a distance metric and clustering techniques but there does not seem any equivalents for softmax in data mining. Neural net algorithms might be implemented with R-package but their use in native data mining techniques seems limited. clustering and reverse clustering could be combined for softmax but this May may be more tedious than inlined neural net method.

#codingexercise
We talked about exponential and normal distribution. Let us state the uniform distribution in the interval range a to b

double GetUniformDistribution(double a, double b, double x)
{
Debug.Assert(b-a > 0);
if (a <= x && x <=b) 
{
   return 1/(b-a);
}
return 0;
}
#codingexercise
int GetFirstIndexInListWithStepSizeAtMostK(List<int> A, int x, int k)
{
int i = 0;
while (i < A.Length)
{
if (A[i] == x)
   return i;
i = i + Math.Max(1, Math.Abs(A[i]-x)/k);
}
return -1;
}

Wednesday, March 7, 2018

We were discussing Signature verification methods. We reviewed the stages involved with Signature verification. Then we also enumerated the feature extraction techniques. After that, we compared online and offline verification techniques. We also discussed the limitations of image processing and the adaptations for video processing.Then we proceeded to discussing image embedding in general.
We discussed Convolutional Neural Network (CNN) in image and object embedding in a shared space. Then we mentioned shape signature.
The purpose of the embedding is to map an image to a point in the embedding space so that it is close to a point attributed to a 3D model of a similar object. A large amount of training data consisting of images synthesized from 3D shapes is used to train the CNN.
Each shape is given a signature. This makes it easy to perform shape matching, organization and retrieval.  The shape signatures are computed using Light Field Descriptor. By re-using projections or views, the shape signature computation does not need any generalization.
Next we read about image retrieval in this framework.
The content-based image retrieval involves searching for an image that is similar to the query. Similarity can be low-level such as color and texture or high-level such as latent objects. In this scheme, both images and shapes are embedded into the same space.This space then leverages the robust distance metric for 3D shapes and trains a CNN for purifying and mapping real world images into this pre-built embedding space. Since the space is constructed already, there is a separation between that process and the image embedding process so that this becomes tractable. Moreover some synthesized images with annotations are used thereby eliminating the need for manual work in gaining annotations.

Object embedding in images used neural net. word embedding in documents used neural net  As such we don't yet have a technique that determines cohesive and adhesive properties other than vector space clustering. Is it possible to transform the embedding into a data mining problem ?

#codingexercise
How do you get the z-score in a normal probability distribution ?
double GetZScore(double X, double mu, Double sigma)
{
Debug.assert(sigma != 0);
return (X-mu)/sigma;
}

A step array is an array of integer where each element has a difference of atmost k with its neighbor. Given a key x, we need to find the index value of k if multiple element exist return the index of any  occurrence of key.
Input : arr[] = {4, 5, 6, 7, 6}
           k = 1
           x = 6
Output : 2

int GetIndex(List<int> A, int x, int k)
{
int i = 0;
while (i < A.Length)
{
if (A[i] == x)
   return i;
i = i + Math.Max(1, Math.Abs(A[i]-x)/k);
}
return -1;
}
If we were to return only the first element, we could scan the elements at positions before the index from where we exit the loop.

Tuesday, March 6, 2018

We were discussing Signature verification methods. We reviewed the stages involved with Signature verification. Then we also enumerated the feature extraction techniques. After that, we compared online and offline verification techniques. We also discussed the limitations of image processing and the adaptations for video processing.Then we proceeded to discussing image embedding in general.
Today we continue our discussion of Convolutional Neural Network (CNN) in image and object embedding in a shared space.
The purpose of the embedding is to map an image to a point in the embedding space so that it is close to a point attributed to a 3D model of a similar object. A large amount of training data consisting of images synthesized from 3D shapes is used to train the CNN.
In order to play up the latent objects in images, similar objects were often used in dissimilar images. The dissimilarity was based on viewpoint, lighting, background differences, partial hiding and so on. 3D object representations do not suffer from these dissimilarities and are therefore much easier to establish similarity.
Each shape is given a signature. This makes it easy to perform shape matching, organization and retrieval.  The notion comes from computer vision and computer graphics. There shape signatures have been associated with geometric properties of the shape such as volume, distance and curvature or 2D projections. They sometimes include graph representations to get a topographical distribution of the shape. In CNN, shape signatures are computed using Light Field Descriptor. In this approach, shapes are indexed via a set of 2D projections or views. This depends directly on the views. A view based distance metric can then be derived from these metrics. The shape signature for each shape then becomes its embedding point in the shared embedding space. By re-using projections or views, the shape signature computation does not need any generalization. Instead its embedding into the robust space is utilized.

#codingexercise
How much time do we need to wait before a given event occurs.
This question is usually answered in the form of exponential probability distribution. The unknown time is represented by a random variable.
If the probability of the event happening in a given interval is proportional to the length of the interval then we have an exponential diatribution.
double GetProbabilityDistribution (double lambda, double x)
{
if (inclusive (x) == false)
     return 0;
return lambda *.math.pow (e, - lambda*x);
}