2012--Isotropic Hashing

2012--Isotropic Hashing
2012--Isotropic Hashing

Isotropic Hashing

Weihao Kong,Wu-Jun Li

Shanghai Key Laboratory of Scalable Computing and Systems Department of Computer Science and Engineering,Shanghai Jiao Tong University,China

{kongweihao,liwujun}@https://www.360docs.net/doc/c810482967.html,

Abstract

Most existing hashing methods adopt some projection functions to project the o-

riginal data into several dimensions of real values,and then each of these projected

dimensions is quantized into one bit(zero or one)by thresholding.Typically,the

variances of different projected dimensions are different for existing projection

functions such as principal component analysis(PCA).Using the same number

of bits for different projected dimensions is unreasonable because larger-variance

dimensions will carry more information.Although this viewpoint has been widely

accepted by many researchers,it is still not veri?ed by either theory or experiment

because no methods have been proposed to?nd a projection with equal variances

for different dimensions.In this paper,we propose a novel method,called isotrop-

ic hashing(IsoHash),to learn projection functions which can produce projected

dimensions with isotropic variances(equal variances).Experimental results on

real data sets show that IsoHash can outperform its counterpart with different vari-

ances for different dimensions,which veri?es the viewpoint that projections with

isotropic variances will be better than those with anisotropic variances.

1Introduction

Due to its fast query speed and low storage cost,hashing[1,5]has been successfully used for approximate nearest neighbor(ANN)search[28].The basic idea of hashing is to learn similarity-preserving binary codes for data representation.More speci?cally,each data point will be hashed into a compact binary string,and similar points in the original feature space should be hashed into close points in the hashcode https://www.360docs.net/doc/c810482967.html,pared with the original feature representation,hashing has two advantages.One is the reduced storage cost,and the other is the constant or sub-linear query time complexity[28].These two advantages make hashing become a promising choice for ef?cient ANN search in massive data sets[1,5,6,9,10,14,15,17,20,21,23,26,29,30,31,32,33,34]. Most existing hashing methods adopt some projection functions to project the original data into several dimensions of real values,and then each of these projected dimensions is quantized into one bit(zero or one)by thresholding.Locality-sensitive hashing(LSH)[1,5]and its extension-s[4,18,19,22,25]use simple random projections for hash functions.These methods are called data-independent methods because the projection functions are independent of training data.Anoth-er class of methods are called data-dependent methods,whose projection functions are learned from training data.Representative data-dependent methods include spectral hashing(SH)[31],anchor graph hashing(AGH)[21],sequential projection learning(SPL)[29],principal component analy-sis[13]based hashing(PCAH)[7],and iterative quantization(ITQ)[7,8].SH learns the hashing functions based on spectral graph partitioning.AGH adopts anchor graphs to speed up the com-putation of graph Laplacian eigenvectors,based on which the Nystr¨o m method is used to compute projection functions.SPL leans the projection functions in a sequential way that each function is designed to correct the errors caused by the previous one.PCAH adopts principal component anal-ysis(PCA)to learn the projection functions.ITQ tries to learn an orthogonal rotation matrix to re?ne the initial projection matrix learned by PCA so that the quantization error of mapping the data

to the vertices of binary hypercube is https://www.360docs.net/doc/c810482967.html,pared to the data-dependent methods,the data-independent methods need longer codes to achieve satisfactory performance [7].

For most existing projection functions such as those mentioned above,the variances of different projected dimensions are different.Many researchers [7,12,21]have argued that using the same number of bits for different projected dimensions with unequal variances is unreasonable because larger-variance dimensions will carry more information.Some methods [7,12]use orthogonal trans-formation to the PCA-projected data with the expectation of balancing the variances of different PCA dimensions,and achieve better performance than the original PCA based hashing.However,to the best of our knowledge,there exist no methods which can guarantee to learn a projection with equal variances for different dimensions.Hence,the viewpoint that using the same number of bit-s for different projected dimensions is unreasonable has still not been veri?ed by either theory or experiment.

In this paper,a novel hashing method,called isotropic hashing (IsoHash),is proposed to learn a pro-jection function which can produce projected dimensions with isotropic variances (equal variances).To the best of our knowledge,this is the ?rst work which can learn projections with isotropic vari-ances for hashing.Experimental results on real data sets show that IsoHash can outperform its counterpart with anisotropic variances for different dimensions,which veri?es the intuitive view-point that projections with isotropic variances will be better than those with anisotropic variances.Furthermore,the performance of IsoHash is also comparable,if not superior,to the state-of-the-art methods.

2

Isotropic Hashing

2.1

Problem Statement

Assume we are given n data points {x 1,x 2,···,x n }with x i ∈R d ,which form the columns of the data matrix X ∈R d ×n .Without loss of generality,in this paper the data are assumed to be zero centered which means n

i =1x i =0.The basic idea of hashing is to map each point x i into a binary string y i ∈{0,1}m with m denoting the code size.Furthermore,close points in the original space R d should be hashed into similar binary codes in the code space {0,1}m to preserve the similarity structure in the original space.In general,we compute the binary code of x i as y i =[h 1(x i ),h 2(x i ),···,h m (x i )]T with m binary hash functions {h k (·)}m k =1.Because it is NP hard to directly compute the best binary functions h k (·)for a given data set [31],most hashing methods adopt a two-stage strategy to learn h k (·).In the projection stage,m real-valued projection functions {f k (x )}m k =1are learned and each function can generate one real value.Hence,we have m projected dimensions each of which corresponds to one projection function.In the quantization stage,the real-values are quantized into a binary string by thresholding.

Currently,most methods use one bit to quantize each projected dimension.More speci?cally,h k (x i )=sgn (f k (x i ))where sgn (x )=1if x ≥0and 0otherwise.The exceptions of the quan-tization methods only contain AGH [21],DBQ [14]and MH [15],which use two bits to quantize each dimension.In sum,all of these methods adopt the same number (either one or two)of bits for different projected dimensions.However,the variances of different projected dimensions are unequal,and larger-variance dimensions typically carry more information.Hence,using the same number of bits for different projected dimensions with unequal variances is unreasonable,which has also been argued by many researchers [7,12,21].Unfortunately,there exist no methods which can learn projection functions with equal variances for different dimensions.In the following content of this section,we present a novel model to learn projections with isotropic variances.2.2

Model Formulation

The idea of our IsoHash method is to learn an orthogonal matrix to rotate the PCA projection matrix.To generate a code of m bits,PCAH performs PCA on X ,and then use the top m eigenvectors of the covariance matrix XX T as columns of the projection matrix W ∈R d ×m .Here,top m eigenvectors are those corresponding to the m largest eigenvalues {λk }m k =1,generally arranged with the non-

increasing order λ1≥λ2≥···≥λm .Hence,the projection functions of PCAH are de?ned as

follows:f k (x )=w T

k x ,where w k is the k th column of W .Let λ=[λ1,λ2,···,λm ]T and Λ=diag (λ),where diag (λ)denotes the diagonal matrix whose diagonal entries are formed from the vector λ.It is easy to prove that W T XX T W =Λ.Hence,the variance of the values {f k (x i )}n i =1on the k th projected dimension,which corresponds to the k th

row of W T

X ,is λk .Obviously,the variances for different PCA dimensions are anisotropic.To get isotropic projection functions,the idea of our IsoHash method is to learn an orthogonal matrix Q ∈R m ×m which makes Q T W T XX T W Q become a matrix with equal diagonal values,i.e.,[Q T W T XX T W Q ]11=[Q T W T XX T W Q ]22=···=[Q T W T XX T W Q ]mm .Here,A ii denotes the i th diagonal entry of a square matrix A ,and a matrix Q is said to be orthogonal if Q T Q =I where I is an identity matrix whose dimensionality depends on the context.The effect of the orthogonal matrix Q is to rotate the coordinate axes while keeping the Euclidean distances between any two points unchanged.It is easy to prove that the new projection functions of IsoHash are f k (x )=(W Q )T k x which have the same (isotropic)variance.Here (W Q )k denotes the k th column of W Q .

If we use tr(A )to denote the trace of a symmetric matrix A ,we have the following Lemma 1.Lemma 1.If Q T Q =I ,tr(Q T AQ )=tr(A ).

Based on Lemma 1,we have tr(Q T W T XX T W Q )=tr(W T XX T W )=tr(Λ)= m

i =1λi if

Q T Q =I .Hence,to make Q T W T

XX T W Q become a matrix with equal diagonal values,we should set this diagonal value a = m

i =1λi

m .Let

a =[a 1,a 2,···,a m ]with a i =a =

m

i =1

λi

m

,(1)

and

T (z )={T ∈R m ×m |diag (T )=diag (z )},

where z is a vector of length m ,diag (T )is overloaded to denote a diagonal matrix with the same diagonal entries of matrix T .

Based on our motivation of IsoHash,we can de?ne the problem of IsoHash as follows:

Problem 1.The problem of IsoHash is to ?nd an orthogonal matrix Q making Q T W T XX T W Q ∈T (a ),where a is de?ned in (1).Then,we have the following Theorem 1:

Theorem 1.Assume Q T Q =I and T ∈T (a ).If Q T ΛQ =T ,Q will be a solution to the problem of IsoHash.

Proof.Because W T XX T W =Λ,we have Q T ΛQ =Q T [W T XX T W ]Q .It is obvious that Q will be a solution to the problem of IsoHash.As in [2],we de?ne

M (Λ)={Q T ΛQ |Q ∈O (m )},

(2)

where O (m )is the set of all orthogonal matrices in R m ×m ,i.e.,Q T Q =I .

According to Theorem 1,the problem of IsoHash is equivalent to ?nding an orthogonal matrix Q for the following equation [2]:

||T ?Z ||F =0,

(3)where T ∈T (a ),Z ∈M (Λ),||·||F denotes the Frobenius norm.Please note that for ease of understanding,we use the same notations as those in [2].

In the following content,we will use the Schur-Horn lemma [11]to prove that we can always ?nd a solution to problem (3).

Lemma2.[Schur-Horn Lemma]Let c={c i}∈R m and b={b i}∈R m be real vectors in non-increasing order respectively1,i.e.,c1≥c2≥···≥c m,b1≥b2≥···≥b m.There exists a Hermitian matrix H with eigenvalues c and diagonal values b if and only if

k

i=1b i≤

k

i=1

c i,for any k=1,2,...,m,

m

i=1b i=

m

i=1

c i.

Proof.Please refer to Horn’s article[11].

Base on Lemma2,we have the following Theorem2.

Theorem2.There exists a solution to the IsoHash problem in(3).And this solution is in the intersection of T(a)and M(Λ).

Proof.Becauseλ1≥λ2≥···≥λm and a1=a2=···=a m= m

i=1

λi

m

,it is easy to

prove that k

i=1

λi

k

m

i=1

λi

m

for any k.Hence,

k

i=1

λi=k×

k

i=1

λi

k

≥k×

m

i=1

λi

m

=

k

i=1a i.Furthermore,we can prove that

m

i=1

λi=

m

i=1

a i.According to Lemma2,there exists

a Hermitian matrix H with eigenvaluesλand diagonal values a.

Moreover,we can prove that H is in the intersection of T(a)and M(Λ),i.e.,H∈T(a)and H∈M(Λ).

According to Theorem2,to?nd a Q solving the problem in(3)is equivalent to?nding the intersec-tion point of T(a)and M(Λ),which is just an inverse eigenvalue problem called SHIEP in[2]. 2.3Learning

The problem in(3)can be reformulated as the following optimization problem:

argmin

Q:T∈T(a),Z∈M(Λ)

||T?Z||F.(4)

As in[2],we propose two algorithms to learn Q:one is called lift and projection(LP),and the other is called gradient?ow(GF).For ease of understanding,we use the same notations as those in[2], and some proofs of theorems are omitted.The readers can refer to[2]for the details.

2.3.1Lift and Projection

The main idea of lift and projection(LP)algorithm is to alternate between the following two steps:?Lift step:

Given a T(k)∈T(a),we?nd the point Z(k)∈M(Λ)such that||T(k)?Z(k)||

F =

dist(T(k),M(Λ)),where dist(T(k),M(Λ))denotes the minimum distance between T(k) and the points in M(Λ).

?Projection step:

Given a Z(k),we?nd T(k+1)∈T(a)such that||T(k+1)?Z(k)||

F =dist(T(a),Z(k)),

where dist(T(a),Z(k))denotes the minimum distance between Z(k)and the points in T(a).

1Please note in[2],the values are in increasing order.It is easy to prove that our presentation of Schur-Horn lemma is equivalent to that in[2].The non-increasing order is chosen here just because it will facilitate our following presentation due to the non-increasing order of the eigenvalues inΛ.

We call Z(k)a lift of T(k)onto M(Λ)and T(k+1)a projection of Z(k)onto T(a).The projection operation is easy to complete.Suppose Z(k)=[z ij],then T(k+1)=[t ij]must be given by

t ij= z

ij

,if i=j

a i,if i=j

(5)

For the lift operation,we have the following Theorem3.

Theorem3.Suppose T=Q T DQ is an eigen-decomposition of T where D=diag(d)with d=[d1,d2,...,d m]T being T’s eigenvalues which are ordered as d1≥d2≥···≥d m.Then the nearest neighbor of T in M(Λ)is given by

Z=Q TΛQ.(6) Proof.See Theorem4.1in[3].

Since in each step we minimize the distance between T and Z,we have

||T(k)?Z(k)||F≥||T(k+1)?Z(k)||F≥||T(k+1)?Z(k+1)||F.

It is easy to see that(T(k),Z(k))will converge to a stationary point.The whole IsoHash algorithm based on LP,abbreviated as IsoHash-LP,is brie?y summarized in Algorithm1.

Algorithm1Lift and projection based IsoHash(IsoHash-LP)

Input:X∈R d×n,m∈N+,t∈N+

?[Λ,W]=P CA(X,m),as stated in Section2.2.

?Generate a random orthogonal matrix Q0∈R m×m.

?Z(0)←Q T0ΛQ0.

?for k=1→t do

Calculate T(k)from Z(k?1)by equation(5).

Perform eigen-decomposition of T(k)to get Q T

k DQ k=T(k).

Calculate Z(k)from Q k andΛby equation(6).

?end for

?Y=sgn(Q T t W T X).

Output:Y

Because M(Λ)is not a convex set,the stationary point we?nd is not necessarily inside the intersec-tion of T(a)and M(Λ).For example,if we set Z(0)=Λ,the lift and projection learning algorithm would get no progress because the Z and T are already in a stationary point.To solve this problem of degenerate solutions,we initiate Z as a transformedΛwith some random orthogonal matrix Q0, which is illustrated in Algorithm1.

2.3.2Gradient Flow

Another learning algorithm is a continuous one based on the construction of a gradient?ow(GF) on the surface M(Λ)that moves towards the desired intersection point.Because there always ex-ists a solution for the problem in(3)according to Theorem2,the objective function in(4)can be reformulated as follows[2]:

min Q∈O(m)F(Q)=

1

2

||diag(Q TΛQ)?diag(a)||2F.(7)

The details about how to optimize(7)can be found in[2].We just show some key steps of the learning algorithm in the following content.

The gradient?F at Q can be calculated as

?F(Q)=2Λβ(Q),(8) whereβ(Q)=diag(Q TΛQ)?diag(a).Once we have computed the gradient of F,it can be projected onto the manifold O(m)according to the following Theorem4.

Theorem4.The projection of?F(Q)onto O(m)is given by

g(Q)=Q[Q TΛQ,β(Q)](9) where[A,B]=AB?BA is the Lie bracket.

Proof.See the formulas(20),(21)and(22)in[3].

The vector?eld˙Q=?g(Q)de?nes a steepest descent?ow on the manifold O(m)for function F(Q).Letting Z=Q TΛQ andα(Z)=β(Q),we get

˙Z=[Z,[α(Z),Z]],(10) where˙Z is an isospectral?ow that moves to reduce the objective function F(Q).

As stated by Theorems3.3and3.4in[2],a stable equilibrium point of(10)must be combined withβ(Q)=0,which means that F(Q)has decreased to zero.Hence,the gradient?ow method can always?nd an intersection point as the solution.The whole IsoHash algorithm based on GF, abbreviated as IsoHash-GF,is brie?y summarized in Algorithm2.

Algorithm2Gradient?ow based IsoHash(IsoHash-GF)

Input:X∈R d×n,m∈N+

?[Λ,W]=P CA(X,m),as stated in Section2.2.

?Generate a random orthogonal matrix Q0∈R m×m.

?Z(0)←Q T0ΛQ0.

?Start integration from Z=Z(0)with gradient computed from equation(10).

?Stop integration when reaching a stable equilibrium point.

?Perform eigen-decomposition of Z to get Q TΛQ=Z.

?Y=sgn(Q T W T X).

Output:Y

We now discuss some implementation details of IsoHash-GF.Since all diagonal matrices in M(Λ) result in˙Z=0,one should not useΛas the starting point.In our implementation,we use the same method as that in IsoHash-LP to avoid this degenerate case,i.e.,a random orthogonal transformation matrix Q0is use to rotateΛ.To integrate Z with gradient in(10),we use Adams-Bashforth-Moulton PECE solver in[27]where the parameter RelTol is set to10?3.The relative error of the algorithm is computed by comparing the diagonal entries of Z to the target diag(a).The whole integration process will be terminated when their relative error is below10?7.

2.4Complexity Analysis

The learning of our IsoHash method contains two phases:the?rst phase is PCA and the second phase is LP or GF.The time complexity of PCA is O(min(n2d,nd2)).The time complexity of LP after PCA is O(m3t),and that of GF after PCA is O(m3).In our experiments,t is set to100 because good performance can be achieved at this setting.Because m is typically set to be a very small number like64or128,the main time complexity of IsoHash is from the PCA phase.In general,the training of IsoHash-GF will be faster than IsoHash-LP in our experiments.

One promising property of both LP and GF is that the time complexity after PCA is independent of the number of training data,which makes them scalable to large-scale data sets.

3Relation to Existing Works

The most related method of IsoHash is ITQ[7],because both ITQ and IsoHash have to learn an orthogonal matrix.However,IsoHash is different from ITQ in many aspects:?rstly,the goal of IsoHash is to learn a projection with isotropic variances,but the results of ITQ cannot necessari-ly guarantee isotropic variances;secondly,IsoHash directly learns the orthogonal matrix from the eigenvalues and eigenvectors of PCA,but ITQ?rst quantizes the PCA results to get some binary

codes,and then learns the orthogonal matrix based on the resulting binary codes;thirdly,IsoHash has an explicit objective function to optimize,but ITQ uses a two-step heuristic strategy whose goal cannot be formulated by a single objective function;fourthly,to learn the orthogonal matrix, IsoHash uses Lift and Projection or Gradient Flow,but ITQ uses Procruster method which is much slower than IsoHash.From the experimental results which will be presented in the next section,we can?nd that IsoHash can achieve accuracy comparable to ITQ with much faster training speed.

4Experiment

4.1Data Sets

We evaluate our methods on two widely used data sets,CIFAR[16]and LabelMe[28].

The?rst data set is CIFAR-10[16]which consists of60,000images.These images are manually labeled into10classes,which are airplane,automobile,bird,cat,deer,dog,frog,horse,ship,and truck.The size of each image is32×32pixels.We represent them with256-dimensional gray-scale GIST descriptors[24].

The second data set is22K LabelMe used in[23,28]which contains22,019images sampled from the large LabelMe data set.As in[28],The images are scaled to32×32pixels,and then represented by512-dimensional GIST descriptors[24].

4.2Evaluation Protocols and Baselines

As the protocols widely used in recent papers[7,23,25,31],Euclidean neighbors in the original s-pace are considered as ground truth.More speci?cally,a threshold of the average distance to the50th nearest neighbor is used to de?ne whether a point is a true positive or not.Based on the Euclidean ground truth,we compute the precision-recall curve and mean average precision(mAP)[7,21].For all experiments,we randomly select1000points as queries,and leave the rest as training set to learn the hash functions.All the experimental results are averaged over10random training/test partitions. Although a lot of hashing methods have been proposed,some of them are either supervised[23] or semi-supervised[29].Our IsoHash method is essentially an unsupervised one.Hence,for fair comparison,we select the most representative unsupervised methods for evaluation,which contain PCAH[7],ITQ[7],SH[31],LSH[1],and SIKH[25].Among these methods,PCAH,ITQ and SH are data-dependent methods,while SIKH and LSH are data-independent methods.

All experiments are conducted on our workstation with Intel(R)Xeon(R)CPU X7560@2.27GHz and64G memory.

4.3Accuracy

Table1shows the Hamming ranking performance measured by mAP on LabelMe and CIFAR.It is clear that our IsoHash methods,including both IsoHash-GF and IsoHash-LP,achieve far better performance than PCAH.The main difference between IsoHash and PCAH is that the PCAH di-mensions have anisotropic variances while IsoHash dimensions have isotropic variances.Hence, the intuitive viewpoint that using the same number of bits for different projected dimensions with anisotropic variances is unreasonable has been successfully veri?ed by our experiments.Further-more,the performance of IsoHash is also comparable,if not superior,to the state-of-the-art methods, such as ITQ.

Figure1illustrates the precision-recall curves on LabelMe data set with different code sizes.The relative performance in the precision-recall curves on CIFAR is similar to that on LabelMe.We omit the results on CIFAR due to space limitation.Once again,we can?nd that our IsoHash methods can achieve performance which is far better than PCAH and comparable to the state-of-the-art.

4.4Computational Cost

Table2shows the training time on CIFAR.We can see that our IsoHash methods are much faster than ITQ.The time complexity of ITQ also contains two parts:the?rst part is PCA which is the same

Table1:mAP on LabelMe and CIFAR data sets.

Method LabelMe CIFAR

#bits326496128256326496128256 IsoHash-GF0.25800.32690.35280.36620.38890.22490.29690.32560.33570.3600 IsoHash-LP0.25340.32230.35770.38260.42740.19070.26240.30270.32230.3651 PCAH0.05160.04010.03410.03070.02320.03190.02740.02410.02160.0168 ITQ0.27860.33280.35040.36150.37280.24900.30510.32380.33190.3436 SH0.08260.10340.14470.16530.20800.05100.05890.08020.11210.1535 SIKH0.05900.14820.20740.25260.44880.03530.09020.12450.19090.3614 LSH0.15490.25740.31470.33750.40340.10520.19070.23960.27760.3432

(a)32bits

(b)64bits

(c)96bits

(d)256bits Figure1:Precision-recall curves on LabelMe data set.

as that in IsoHash,and the second part is an iteration algorithm to rotate the original PCA matrix with time complexity O(nm2),where n is the number of training points and m is the number of bits in the binary code.Hence,as the number of training data increases,the second-part time complexity of ITQ will increase linearly to the number of training points.But the time complexity of IsoHash after PCA is independent of the number of training points.Hence,IsoHash will be much faster than ITQ,particularly in the case with a large number of training points.This is clearly shown in Figure2 which illustrates the training time when the numbers of training data are changed.

Table2:Training time(in second)on CIFAR.

#bits326496128256

IsoHash-GF 2.48 2.45 2.70 3.00 5.55

IsoHash-LP 2.14 2.43 2.94 3.478.83

PCAH 1.84 2.14 2.23 2.36 2.92 ITQ 4.35 6.339.7312.4029.25 SH 1.60 3.418.3713.6649.44 SIKH 1.30 1.44 1.57 1.55 2.20 LSH0.050.080.110.190.31

T

r

a

i

n

i

n

g

T

i

m

e

(

s

)

Figure2:Training time on CIFAR.

5Conclusion

Although many researchers have intuitively argued that using the same number of bits for different projected dimensions with anisotropic variances is unreasonable,this viewpoint has still not been veri?ed by either theory or experiment because no methods have been proposed to?nd projection functions with isotropic variances for different dimensions.The proposed IsoHash method in this paper is the?rst work to learn projection functions which can produce projected dimensions with isotropic variances(equal variances).Experimental results on real data sets have successfully veri-?ed the viewpoint that projections with isotropic variances will be better than those with anisotropic variances.Furthermore,IsoHash can achieve accuracy comparable to the state-of-the-art methods with faster training speed.

6Acknowledgments

This work is supported by the NSFC(No.61100125),the863Program of China(No.2011AA01A202,No.2012AA011003),and the Program for Changjiang Scholars and Innovative Research Team in University of China(IRT1158,PCSIRT).

References

[1] A.Andoni and P.Indyk.Near-optimal hashing algorithms for approximate nearest neighbor in high

https://www.360docs.net/doc/c810482967.html,mun.ACM,51(1):117–122,2008.

[2]M.T.Chu.Constructing a Hermitian matrix from its diagonal entries and eigenvalues.SIAM Journal on

Matrix Analysis and Applications,16(1):207–217,1995.

[3]M.T.Chu and K.R.Driessel.The projected gradient method for least squares matrix approximations with

spectral constraints.SIAM Journal on Numerical Analysis,pages1050–1060,1990.

[4]M.Datar,N.Immorlica,P.Indyk,and V.S.Mirrokni.Locality-sensitive hashing scheme based on p-stable

distributions.In Proceedings of the ACM Symposium on Computational Geometry,2004.

[5] A.Gionis,P.Indyk,and R.Motwani.Similarity search in high dimensions via hashing.In VLDB,1999.

[6]Y.Gong,S.Kumar,V.Verma,and https://www.360docs.net/doc/c810482967.html,zebnik.Angular quantization based binary codes for fast similarity

search.In NIPS,2012.

[7]Y.Gong and https://www.360docs.net/doc/c810482967.html,zebnik.Iterative quantization:A Procrustean approach to learning binary codes.In

CVPR,2011.

[8]Y.Gong,https://www.360docs.net/doc/c810482967.html,zebnik,A.Gordo,and F.Perronnin.Iterative quantization:A Procrustean approach to

learning binary codes for large-scale image retrieval.In IEEE Trans.Pattern Anal.Mach.Intell.,2012.

[9]J.He,W.Liu,and S.-F.Chang.Scalable similarity search with optimized kernel hashing.In KDD,2010.

[10]J.-P.Heo,Y.Lee,J.He,S.-F.Chang,and S.-E.Yoon.Spherical hashing.In CVPR,2012.

[11] A.Horn.Doubly stochastic matrices and the diagonal of a rotation matrix.American Journal of Mathe-

matics,76(3):620–630,1954.

[12]H.Jegou,M.Douze,C.Schmid,and P.P′e rez.Aggregating local descriptors into a compact image

representation.In CVPR,2010.

[13]I.Jolliffe.Principal Component Analysis.Springer,2002.

[14]W.Kong and W.-J.Li.Double-bit quantization for hashing.In AAAI,2012.

[15]W.Kong,W.-J.Li,and M.Guo.Manhattan hashing for large-scale image retrieval.In SIGIR,2012.

[16] A.Krizhevsky.Learning multiple layers of features from tiny images.Tech report,University of Toronto,

2009.

[17] B.Kulis and T.Darrell.Learning to hash with binary reconstructive embeddings.In NIPS,2009.

[18] B.Kulis and K.Grauman.Kernelized locality-sensitive hashing for scalable image search.In ICCV,

2009.

[19] B.Kulis,P.Jain,and K.Grauman.Fast similarity search for learned metrics.IEEE Trans.Pattern Anal.

Mach.Intell.,31(12):2143–2157,2009.

[20]W.Liu,J.Wang,R.Ji,Y.-G.Jiang,and S.-F.Chang.Supervised hashing with kernels.In CVPR,2012.

[21]W.Liu,J.Wang,S.Kumar,and S.-F.Chang.Hashing with graphs.In ICML,2011.

[22]Y.Mu and S.Yan.Non-metric locality-sensitive hashing.In AAAI,2010.

[23]M.Norouzi and D.J.Fleet.Minimal loss hashing for compact binary codes.In ICML,2011.

[24] A.Oliva and A.Torralba.Modeling the shape of the scene:A holistic representation of the spatial

envelope.International Journal of Computer Vision,42(3):145–175,2001.

[25]M.Raginsky and https://www.360docs.net/doc/c810482967.html,zebnik.Locality-sensitive binary codes from shift-invariant kernels.In NIPS,

2009.

[26]R.Salakhutdinov and G.E.Hinton.Semantic hashing.Int.J.Approx.Reasoning,50(7):969–978,2009.

[27]L.F.Shampine and https://www.360docs.net/doc/c810482967.html,puter solution of ordinary differential equations:the initial value

problem.Freeman,San Francisco,California,1975.

[28] A.Torralba,R.Fergus,and Y.Weiss.Small codes and large image databases for recognition.In CVPR,

2008.

[29]J.Wang,S.Kumar,and S.-F.Chang.Sequential projection learning for hashing with compact codes.In

ICML,2010.

[30]J.Wang,S.Kumar,and S.-F.Chang.Semi-supervised hashing for large-scale search.IEEE Trans.Pattern

Anal.Mach.Intell.,34(12):2393–2406,2012.

[31]Y.Weiss,A.Torralba,and R.Fergus.Spectral hashing.In NIPS,2008.

[32]H.Xu,J.Wang,Z.Li,G.Zeng,S.Li,and https://www.360docs.net/doc/c810482967.html,plementary hashing for approximate nearest

neighbor search.In ICCV,2011.

[33] D.Zhang,F.Wang,and https://www.360docs.net/doc/c810482967.html,posite hashing with multiple information sources.In SIGIR,2011.

[34]Y.Zhen and D.-Y.Yeung.A probabilistic model for multimodal hash function learning.In KDD,2012.

哈希算法散列

计算机算法领域 基本知识 Hash,一般翻译做“散列”,也有直接音译为”哈希“的,就是把任意长度的输入(又叫做预映射,pre-image),通过散列算法,变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,也就是,散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,而不可能从散列值来唯一的确定输入值。简单的说就是一种将任意长度的消息压缩到某一固定长度的消息摘要的函数。 HASH主要用于信息安全领域中加密算法,他把一些不同长度的信息转化成杂乱的128位的编码里,叫做HASH值. 也可以说,hash就是找到一种数据内容和数据存放地址之间的映射关系 基本概念 * 若结构中存在关键字和K相等的记录,则必定在f(K)的存储位置上。由此,不需比较便可直接取得所查记录。称这个对应关系f为散列函数(Hash function),按这个思想建立的表为散列表。 * 对不同的关键字可能得到同一散列地址,即key1≠key2,而f(key1)=f(key2),这种现象称冲突。具有相同函数值的关键字对该散列函数来说称做同义词。综上所述,根据散列函数H(key)和处理冲突的方法将一组关键字映象到一个有限的连续的地址集(区间)上,并以关键字在地址集中的“象” 作为记录在表中的存储位置,这种表便称为散列表,这一映象过程称为散列造表或散列,所得的存储位置称散列地址。 * 若对于关键字集合中的任一个关键字,经散列函数映象到地址集合中任何一个地址的概率是相等的,则称此类散列函数为均匀散列函数(Uniform Hash function),这就是使关键字经过散列函数得到一个“随机的地址”,从而减少冲突。 常用的构造散列函数的方法 散列函数能使对一个数据序列的访问过程更加迅速有效,通过散列函数,数据元素将被更快地定位ǐ 1. 直接寻址法:取关键字或关键字的某个线性函数值为散列地址。即H(key)=key或H(key) = a?key + b,其中a和b为常数(这种散列函数叫做自身函数) 2. 数字分析法 3. 平方取中法 4. 折叠法 5. 随机数法 6. 除留余数法:取关键字被某个不大于散列表表长m的数p除后所得的余数为散列地址。即H(key) = key MOD p, p<=m。不仅可以对关键字直接取模,也可在折叠、平方取中等运算之后取模。对p的选择很重要,一般取素数或m,若p选的不好,容易产生同义词。 处理冲突的方法 1. 开放寻址法;Hi=(H(key) + di) MOD m, i=1,2,…, k(k<=m-1),其中H(key)为散列函数,m为散列表长,di为增量序列,可有下列三种取法: 1. di=1,2,3,…, m-1,称线性探测再散列; 2. di=1^2, (-1)^2, 2^2,(-2)^2, (3)^2, …, ±(k)^2,(k<=m/2)称二次探测再散列;

什么是哈希函数

什么是哈希函数 哈希(Hash)函数在中文中有很多译名,有些人根据Hash的英文原意译为“散列函数”或“杂凑函数”,有些人干脆把它音译为“哈希函数”,还有些人根据Hash函数的功能译为“压缩函数”、“消息摘要函数”、“指纹函数”、“单向散列函数”等等。 1、Hash算法是把任意长度的输入数据经过算法压缩,输出一个尺寸小了很多的固定长度的数据,即哈希值。哈希值也称为输入数据的数字指纹(Digital Fingerprint)或消息摘要(Message Digest)等。Hash函数具备以下的性质: 2、给定输入数据,很容易计算出它的哈希值; 3、反过来,给定哈希值,倒推出输入数据则很难,计算上不可行。这就是哈希函数的单向性,在技术上称为抗原像攻击性; 4、给定哈希值,想要找出能够产生同样的哈希值的两个不同的输入数据,(这种情况称为碰撞,Collision),这很难,计算上不可行,在技术上称为抗碰撞攻击性; 5、哈希值不表达任何关于输入数据的信息。 哈希函数在实际中有多种应用,在信息安全领域中更受到重视。从哈希函数的特性,我们不难想象,我们可以在某些场合下,让哈希值来“代表”信息本身。例如,检验哈希值是否发生改变,借以判断信息本身是否发生了改变。` 怎样构建数字签名 好了,有了Hash函数,我们可以来构建真正实用的数字签名了。 发信者在发信前使用哈希算法求出待发信息的数字摘要,然后用私钥对这个数字摘要,而不是待发信息本身,进行加密而形成一段信息,这段信息称为数字签名。发信时将这个数字签名信息附在待发信息后面,一起发送过去。收信者收到信息后,一方面用发信者的公钥对数字签名解密,得到一个摘要H;另一方面把收到的信息本身用哈希算法求出另一个摘要H’,再把H和H’相比较,看看两者是否相同。根据哈希函数的特性,我们可以让简短的摘要来“代表”信息本身,如果两个摘要H和H’完全符合,证明信息是完整的;如果不符合,就说明信息被人篡改了。 数字签名也可以用在非通信,即离线的场合,同样具有以上功能和特性。 由于摘要一般只有128位或160位比特,比信息本身要短许多倍,USB Key或IC卡中的微处理器对摘要进行加密就变得很容易,数字签名的过程一般在一秒钟内即可完成。

客户价值识别研究文献综述

客户价值识别文献综述 摘要:客户价值识别是CRM实施中十分重要的一个概念。文章综述了客户价值的内涵,分析归纳了客户生命周期模型、客户感知价值模型、竞争可得性模型的优劣,来引出较为完善的客户识别多维框架模型。 关键词:客户价值识别;客户生命周期价值;客户感知价值;竞争可得性;客户识别多维框架模型 随着经济全球化步伐的进一步加快,国内市场的逐渐饱和,企业之间客户的竞争也愈演愈烈。归结起来,现今企业花招百出的资源、人才、技术的竞争无非就是为了获取更多的客户。然而企业获取的客户中并非所有的客户都是忠诚的,作为企业,如何识别客户,从而针对不同类型的客户展开差异化的营销战略也愈发的重要。鉴于此,有必要对国内外各种客户价值识别的理论方法进行梳理,使企业在进行客户关系管理时更加事半功倍。 一、客户识别的概念 客户识别即通过一系列技术手段,根据大量客户的个性特征、购买记录等可得数据,实现确定出对企业有意义的客户,作为企业客户关系管理的实施对象,从而为企业成功实施CRM提供保障。 客户识别是一个较新的概念,与传统的客户细分与客户选择有着本质的区别。传统营销理论对整个客户群体按照多种因子进行细分,从而选择企业的目标市场。而客户识别则是在已确定的目标市场中通过一系列测量从而筛选出对企业有意义的目标客户。 二、客户识别中的维度 (一)客户感知价值维度CPV(Customer Perceived Value) 客户感知价值从客户角度出发,指的是客户感知到的产品效用与支付价格之间的平衡。产品的价格、质量、品牌形象、服务质量以及客户的个性偏好都会影响客户感知的价值。对于企业来说,只有CPV较高的客户才可能与企业建立并保持长期合作的关系。相对的,CPV较低的客户则与企业建立客户关系的可能性较低。由于“客户将从那些他们认为能提供最高让渡价值的公司购买商品”

色彩感知现象综述

色彩感知现象综述 摘要:本文主要解释了色彩感知的现象,图文并茂的进行分析,指出色彩感知对我们生活当中起到的影响和作用。个人认为色彩的感知会改变我们的情感,会影响我们的心理,会造成我们的错觉。 关键词:色彩的知觉与情感、色彩的温度、色彩的心理效应、色彩的错觉 正文: 色彩来源于光的照射,也就是说没有光就没有色彩,光是人们感知色彩存在的必要条件。1666年英国科学家牛顿发现,太阳光经过三棱镜折射,投射到白色屏幕上,会显出一条美丽的光谱:依次为红、橙、黄、绿、青、蓝、紫七色。只有波长380nm到780nm的辐射能引起人的视觉感,这段光波叫做可见光。在可见光谱内,不同波长的辐射引起不同的色彩感知。 色彩是光源的可见光谱中不同波长的光波作用在不同的物体上,在人眼中引起的不同视觉反映。 目前,国际指认的色彩分类主要依据无彩色系和有彩色系两大颜色序列的内在共 性规律划分而成的。 有彩色系的分类:红、黄、蓝三色 可以调配衍变出其他各种色彩,而 其他色彩无法调出它们故称三原 色,又称三元色。色光的三原色是 红、绿、蓝紫,色料的三原色是品 红、柠檬黄、湖蓝。 间色:有称为“二次色”由两种 原色混合而成。 复色:又称为三次色,是由间色与原色混合而成。 补色:凡两种色光相加呈现白光,颜色相混呈现灰黑色,这两种色光或这两种颜色即互为补色。 色彩的三属性 色相:指各种色彩的相貌,也就是色彩 的色调倾向。我们以红、橙、黄、绿、 蓝、紫6色作为基本色相。或根据不同 的研究体系,以更多些的10色、12色、 24色甚至100色的连续色相环来表示。

明度:指色彩的明亮程度。色彩的明度,和物体表面色光的反射率有关。物体表面的光反射率越大,对视觉刺激的程度就越大,看上去就越亮,这一颜色的明度就越高。 黑白之间不同程度的明暗强度划分,称为明暗阶度。 纯度:纯度指颜色的纯净和鲜艳程度,又称彩度、艳度。色相除了拥有各自的最高纯度外,它们之间也有纯度高低之分,通常可以通过一个水平的直线纯度色阶表确定一种色相的纯度量的变化。 降低色彩纯度的方法:加白、加黑、加灰、加互补色。 色彩的知觉与情感 大量的事实说明,色彩在其物理性质存在的同时,也具备达情感、影响人们心理活动的功能,有着传达信息、感染情绪、唤起记忆、产生联想、象征事物和导致行为多种意义。 激发情感 与色彩传达信息相比,色彩最容易打动人的,实际上是它的“情感色彩”。也就是色彩能激发人感情的作用。 产生联想 我们把因看到某一色彩而想起与该色彩有关的某些事物这一心理活动,称为色彩联想。色彩的联想内容分为具象联想和抽象联想。 红色纯度色阶

一致性哈希算法应用及优化(最简洁明了的教程)

一致性哈希算法的应用及其优化 一.简单哈希算法 哈希(Hash)就是把任意长度的输入通过散列算法,变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,使得散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,而不可能从散列值来唯一的确定输入值。哈希算法是一种消息摘要算法,虽然哈希算法不是一种加密算法,但由于其单向运算,具有一定的不可逆性使其成为加密算法中的一个重要构成部分。 二.分布式缓存问题 哈希算法除了在数据加密中的运用外,也可以用在常见的数据分布式技术中。哈希计算是通过求模运算来计算哈希值的,然后根据哈希值将数据映射到存储空间中。设有由N 个存储节点组成的存储空间,采用简单哈希计算将一个数据对象object 映射到存储空间上的公式为:Hash(object)% N。 现在假设有一个网站,最近发现随着流量增加,服务器压力越来越大,之前直接读写数据库的方式已经不能满足用户的访问,于是想引入Memcached作为缓存机制。现在一共有三台机器可以作为Memcached服务器,如下图1所示。

图1.三台memcached服务器 可以用简单哈希计算:h = Hash(key) % 3 ,其中Hash是一个从字符串到正整数的哈希映射函数,这样能够保证对相同key的访问会被发送到相同的服务器。现在如果我们将Memcached Server分别编号为0、1、2,那么就可以根据上式和key计算出服务器编号h,然后去访问。 但是,由于这样做只是采用了简单的求模运算,使得简单哈希计算存在很多不足: 1)增删节点时,更新效率低。当系统中存储节点数量发生增加或减少时,映射公式将发生变化为Hash(object)%(N±1),这将使得所有object 的映射位置发生变化,整个系统数据对象的映射位置都需要重新进行计算,系统无法对外界访问进行正常响应,将导致系统处于崩溃状态。 2)平衡性差,未考虑节点性能差异。由于硬件性能的提升,新添加的节点具有更好的承载能力,如何对算法进行改进,使节点性能可以得到较好利用,也是亟待解决的一个问题。 3)单调性不足。衡量数据分布技术的一项重要指标是单调性,单调性是指如果已经有一些内容通过哈希计算分派到了相应的缓冲中,当又有新的缓冲加入到系统中时,哈希的结果应能够保证原有已分配的内容可以被映射到新的缓冲中去,而不会被映射到旧的缓冲集合中的其他缓冲区。 由上述分析可知,简单地采用模运算来计算object 的Hash值的算法显得过于简单,存在节点冲突,且难以满足单调性要求。

单向散列函数算法Hash算法

单向散列函数算法(Hash算法): 一种将任意长度的消息压缩到某一固定长度(消息摘要)的函数(过程不可逆),常见的单向散列算法有MD5,SHA.RIPE-MD,HAVAL,N-Hash 由于Hash函数的为不可逆算法,所以软件智能使用Hash函数作为一个加密的中间步骤 MD5算法: 即为消息摘要算法(Message Digest Algorithm),对输入的任意长度的消息进行预算,产生一个128位的消息摘要 简易过程: 1、数据填充..即填出消息使得其长度与448(mod 512)同余,也就是说长度比512要小64位(为什么数据长度本身已经满足却仍然需要填充?直接填充一个整数倍) 填充方法是附一个1在后面,然后用0来填充.. 2、添加长度..在上述结果之后附加64位的消息长度,使得最终消息的长度正好是512的倍数.. 3、初始化变量..用到4个变量来计算消息长度(即4轮运算),设4个变量分别为A,B,C,D(全部为32位寄存器)A=1234567H,B=89abcdefH,C=fedcba98H,D=7654321H 4、数据处理..首先进行分组,以512位为一个单位,以单位来处理消息.. 首先定义4个辅助函数,以3个32为双字作为输入,输出一个32为双字 F(X,Y,Z)=(X&Y)|((~X)&Z) G(X,Y,Z)=(X&Z)|(Y&(~Z)) H(X,Y,Z)=X^Y^Z I(X,Y,Z)=Y^(X|(~Z)) 其中,^是异或操作 这4轮变换是对进入主循环的512为消息分组的16个32位字分别进行如下操作: (重点)将A,B,C,D的副本a,b,c,d中的3个经F,G,H,I运算后的结果与第四个相加,再加上32位字和一个32位字的加法常数(所用的加法常数由这样一张表T[i]定义,期中i为1至64之中的值,T[i]等于4294967296乘以abs(sin(i))所得结果的整数部分)(什么是加法常数),并将所得之值循环左移若干位(若干位是随机的??),最后将所得结果加上a,b,c,d之一(这个之一也是随机的?)(一轮运算中这个之一是有规律的递增的..如下运算式),并回送至A,B,C,D,由此完成一次循环。(这个循环式对4个变量值进行计算还是对数据进行变换??) For i=0 to N/16 do For j=0 to 15 do Set X[i] to M[i*16+j] End AA = A BB=B CC=C DD=D //第一轮,令[ABCD K S I]表示下面的操作: //A=B+((A+F(B,C,D)+X[K]+T[I])<<

顾客满意文献综述.doc

顾客满意文献综述 引言 当今世界企业竞争日趋激烈,竞争之焦点就是顾客竞争,争取和保持顾客是企业生存和发展的使命。企业既要不断争取新顾客,开辟新市场,提高市场占有率,又要保持现有顾客,稳定市场占有率。然而,在企业实际的经营运作中,尤其是服务业,往往一方面大批新顾客源源而来,另一方面许多现有顾客悄悄而去,这就是西方营销界所称的“漏桶”现象。企业要防止顾客流失,堵住“漏桶”,其关键就是要提高和实现高度的顾客满意,以形成良好的顾客口碑和培养顾客忠诚。本文针对国内外学者对顾客满意的研究就顾客满意的定义、顾客满意测量以及与顾客满意相关的因素进行文献综述。 一、顾客满意的定义 1、顾客满意的提出 20 世纪60 年代;1965 年,Cardozo 首次将顾客满意的观点引入营销领域,提出顾客满意会带动顾客的购买行为。 2、顾客满意的研究发展 由于顾客满意管理研究的基本目的是为了预测顾客的行为反应, 因此, 自80 年代以来, 许多学者开始从行为学视角来研究顾客满意的行为结果。这些研究主要形成两大流派。一种观点认为, 顾客满意度对购物意向的影响是通过态度间接产生作用。例如, 01iver(1980) 的研究发现高水平的顾客满意度可增加顾客对品牌的偏爱程度, 进而增强对该品牌的重复购买意向; Bearden and Teel(1983) 在对汽车的研究中发现, 顾客满意度对购买意向的影响受到态度的调节作用。另一种观点认为, 顾客满意度对购买意向具有直接作用。有调查显示, 较高比例的不满意顾客不愿意再购买同样品牌的产品(TARP, 1979) 。

3、顾客满意概念界定 目前,对顾客满意的定义,学术上有两种主要的观点。一种观点是从状态角度来定义顾客满意,认为顾客满意是顾客对购买行为的事后感受,是消费经历所产生的一种结果。如Howard 和Sheth(1969)认为顾客满意是“顾客对其所付出的代价是否获得足够补偿的一种认知状态”;Oliver 和Linda(1981)认为顾客满意是“一种心理状态,顾客根据消费经验所形成的期望与消费经历一致时而产生的一种情感状态”;Westbrook 和Reilly(1983)认为顾客满意是“一种情感反应,这种情感反应是伴随或者是在购买过程中产品陈列以及整体购物环境对消费者的心理影响而产生的”;Kotler 则认为顾客满意是“指一个人通过对一个产品的可感知的效果与他的期望值相比较后形成的感觉状态,是感知的效果和期望值之间的差异函数”。 另一种观点是从过程的角度来定义顾客满意,认为顾客满意是事后对消费行为的评价。如Hun(1977)认为顾客满意是“消费经历至少与期望相一致时而作出的评价”;Engel 和Blackwel(1982)认为顾客满意是“顾客对所购买产品与以前产品信念一致时所作出的评价”;Tse 和Wilton(1988)则认为顾客满意是“顾客在购买行为发生前对产品所形成的期望质量与消费后所感知的质量之间所存在差异的评价”。这些学者认为,在顾客满意的内涵中,评价过程是其核心组成部分。从过程角度对顾客满意的定义囊括了完整的消费经历,指明了产生顾客满意的重要过程。 二、顾客满意测量 1、满意测量的“期望不一致模式” 满意测量的期望不一致模式源于美国营销学者Oliver于1980年提出的期望不一致模型。该模型对顾客满意的心理形成过程作了这样的解释:顾客在购买之前先根据过去经历、广告宣传等途径,形成对产品或服务特征的期望,然后在随后的购买和使用中感受产品和服务的绩效水平,最后将感受到的产品(或服务)绩效与期望进行比较判断。当感知绩效符合顾客期望,顾客既不会满意也不会不满意;而当感知绩效超过顾客的期望(积极的不一致),顾客就会满意;当感知绩效低于顾客的期望(消极的不一致),顾客就会不满意。 因此,期望不一致模式有三种操作化的方法:(1)分别测量期望(消费前)和绩效(消

(完整版)色彩心理——色彩和感觉

色彩感知现象综述 颜色是因为光的折射而产生的。红,黄,蓝是三原色,其它的色彩都可以用这三种色彩调和而成。 颜色分非彩色和彩色两类。非彩色是指黑、白、灰系统色;彩色是指除了非彩色以外的所有色彩。任何色彩都有饱和度和透明度的属性,属性的变化产生不同的色相,所以至少可以制作几百万种色彩。 色彩与眼睛的重要性就像我们的耳朵一定要欣赏音乐一样,很难想象如果在一个没有色彩的世界里,将会是什么样子?色彩能焕发出人们的情感,能描述人们的思想。 色彩它除了要能展现人的心理外,它必须要是易于识别的,背景色被广泛运用在一系列的图形设计中,而且能在心理上引起大家的共鸣,或从该色彩联想到其他的东西。 一个良好的背景平台,能够很好的展现在前景上的东西。 一、色彩的冷暖感 色彩的冷暧是人体本身的经验习惯赋予我们的一种感觉,绝不能用温度来衡量。 “冷”和“暖”这两个词原是指温度的经验。如太阳、火本身的温度很高,它们所射出的红橙色光有导热的功能,使人的皮肤被照后有温暖感。像大海、远山、冰、雪等环境有吸热的功能,这些地方的温度总是比较低,有寒冷感。这些生活经验和印象的积累,使视觉变成了触觉的先导,只要一看到红橙色,心里就会产生温暖和愉快的感觉;一看到蓝色,就会觉得冰冷、凉爽。所以,从色彩的心理学来考虑,红橙色被定为最暖色,绿蓝色被定为最冷色。它们在色立体上的位置分别被称为暖极、冷极,离暖极近的称暖色,像红、橙、黄等;离冷极近的称冷色,像蓝绿、蓝紫等;绿和紫被称为冷暖的中性色。

日本色彩学家曾做过一个试验:将两个工作间分别涂成灰蓝色和红橙色,两个工作间的客观温度条件即物理上的温度相同,劳动强度也一样。在冷色工作间工作的员工,于59华氏度时感到冷,而暖色工作间工作的员工,当温度从59华氏度降低到52华氏度时,仍然不觉得冷。 从色彩的心理学来说,还有一组冷暖色,即白冷、黑暖的概念。当白色反射光线时,也同时反射热量,黑色吸收光线时,也同时吸收热量。因此黑色衣服使我们感觉暖和,适于冬季、寒带;白色衣服使我们感觉凉爽、适于夏季、热带。 不论冷色还是暖色,加百后有冷感,加黑后有暖感。在同一色相中也有冷色感与暖色干之别。冷暖感实际上只是一个相对概念,如大红比玫瑰红暖,但比朱红冷,朱红又比红橙冷,只有处于相对关系的红橙和绿蓝才是冷暖的极端。 值得一提的是:物理学上的色温与色彩的冷暖是有区别的,色温越高色越冷,色温越低色越暖,如处在高温条件下的铁块,400℃以下无色,400℃-700℃为暗红色,700℃-1000℃为鲜红色,1000℃以上为白色。灯泡也一样,瓦数越低越发红,越高则越发白。 二、色彩的空间感 在平面上如想获得立方体的、有深度的空间感,一方面可通过透视原理,用对角线、重叠等方法来形成;另一方面也可运用色彩的冷暖、明暗、彩度以及面积对比来充分体现。 造成色彩空间感觉的因素主要是色的前进和后退。色彩中我们常把暖色称为前进色,冷色称为后退色。其原因是暖色比冷色长波长,长波长的红光和短波长的蓝光通过眼睛水晶体时的折射率不同,当蓝光在视网膜上成像时,红光就只能在视网膜后成像。因此,为使红光在视网膜上成像,水晶体就要变厚一些,把焦距缩短,使成像位置前移。这样,就使得相同

哈 希 常 见 算 法 及 原 理

计算与数据结构篇 - 哈希算法 (Hash) 计算与数据结构篇 - 哈希算法 (Hash) 哈希算法的定义和原理非常简单,基本上一句话就可以概括了。将任意长度的二进制值串映射为固定长度的二进制值串,这个映射的规则就是哈希算法,而通过原始数据映射之后得到的二进制值串就是哈希值。 构成哈希算法的条件: 从哈希值不能反向推导出原始数据(所以哈希算法也叫单向哈希算法)对输入数据非常敏感,哪怕原始数据只修改了一个 Bit,最后得到的哈希值也大不相同; 散列冲突的概率要很小,对于不同的原始数据,哈希值相同的概率非常小; 哈希算法的执行效率要尽量高效,针对较长的文本,也能快速地计算出哈希值。 哈希算法的应用(上篇) 安全加密 说到哈希算法的应用,最先想到的应该就是安全加密。最常用于加密的哈希算法是 MD5(MD5 Message-Digest Algorithm,MD5 消息摘要算法)和 SHA(Secure Hash Algorithm,安全散列算法)。 除了这两个之外,当然还有很多其他加密算法,比如 DES(Data Encryption Standard,数据加密标准)、AES(Advanced Encryption Standard,高级加密标准)。

前面我讲到的哈希算法四点要求,对用于加密的哈希算法来说,有两点格外重要。第一点是很难根据哈希值反向推导出原始数据,第二点是散列冲突的概率要很小。 不过,即便哈希算法存在散列冲突的情况,但是因为哈希值的范围很大,冲突的概率极低,所以相对来说还是很难破解的。像 MD5,有 2^128 个不同的哈希值,这个数据已经是一个天文数字了,所以散列冲突的概率要小于 1-2^128。 如果我们拿到一个 MD5 哈希值,希望通过毫无规律的穷举的方法,找到跟这个 MD5 值相同的另一个数据,那耗费的时间应该是个天文数字。所以,即便哈希算法存在冲突,但是在有限的时间和资-源下,哈希算法还是被很难破解的。 对于加密知识点的补充,md5这个算法固然安全可靠,但网络上也有针对MD5中出现的彩虹表,最常见的思路是在密码后面添加一组盐码(salt), 比如可以使用md5(1234567.'2019@STARK-%$#-idje-789'),2019@STARK-%$#-idje-789 作为盐码起到了一定的保护和安全的作用。 唯一标识(uuid) 我们可以给每一个图片取一个唯一标识,或者说信息摘要。比如,我们可以从图片的二进制码串开头取 100 个字节,从中间取 100 个字节,从最后再取 100 个字节,然后将这 300 个字节放到一块,通过哈希算法(比如 MD5),得到一个哈希字符串,用它作为图片的唯一标识。通过这个唯一标识来判定图片是否在图库中,这样就可以减少很多工作量。

顾客感知论文感知价值理论论文

顾客感知论文感知价值理论论文: 顾客感知价值理论文献综述 摘要:顾客感知价值起源于20世纪80年代的西方,是伴随着市场经济的飞速发展、市场竞争的加剧,消费者占据消费主权,企业为了使顾客满意、获得更多的消费者、加强自身竞争优势而产生的。通过回顾和整理国内外学者对顾客感知价值的研究,以期望对企业在如何应对顾客感知价值方面有所启发。 关键词:顾客感知价值;特性;驱动因素 1 引言 感知价值是营销中一个非常重要的概念,尤其是在市场竞争越来越白热化的时期,顾客感知价值对企业来说变得越来越重要。很多企业在经营的过程中都运用到了顾客感知价值的思想。目前,国内外学者对顾客感知价值进行了深入的研究。 理论界对顾客感知价值的研究,从总体上来说,分为两个大的方向,一个是从企业的角度出发,分析顾客资源对企业所能产生的价值,另外一个是从顾客的角度出发,研究顾客的需求和感知,分析顾客想从企业获得什么,以此指导企业的生产经营活动。本文是从顾客的角度对顾客感知价值进行分析。 2 顾客感知价值的涵义 目前,学者对顾客感知价值进行了大量的研究,他们分别从不同的视角对顾客感知价值进行了阐述,但直到现在还没有统一的概念。

顾客感知价值的思想最早可追溯到1954年德鲁克的思想,他指出顾客购买和消费的不是产品,而是价值。这一思想是德鲁克在其1954年出版的《管理实践》中提出的,但他并未对其进行深入的研究。 Porter(1985)在《竞争优势》一书中提出了“买方价值链”的概念,并指出企业为买方创造的价值如果要得到溢价的回报,它必须为买方所觉察,虽然Porter并没有明确给出顾客感知价值的概念,但为后人研究顾客感知价值提供了理论基础。 Zeithaml(1988)从顾客心理的角度,展开了他对顾客感知价值理论的研究。Zeithaml认为顾客感知价值是顾客在市场交易中根据所得利益和付出的成本进行比较的感知,对产品进行的总体评价。 Monroe(1991)将顾客感知价值定义为“感知利得与感知利失之间的比例”,认为“购买者的价值感知体现了对产品感知质量或感知利益与因支付而产生的感知利失之间的权衡”。感知利得是与使用特定产品相关的实体特性、服务特性和特定使用条件下可能的技术支持;感知利失包括所有与购买行为相关的获得成本、运输、安装、订货处理、维修以及潜在的失效风险。 Philip Kotler(1994)是从让渡价值角度来剖析顾客价值的。他认为顾客感知价值是预期顾客评估一个供应品和认知值的所有价值与是所有成本之差。总顾客价值就是顾客从某一特定供应品中期望的一组经济、功能和心里利益组成的认知货币价值。总顾客成本是在评

色彩感知现象综述

色彩感知现象综述 摘要:我们生活在一个色彩纷呈的世界中,每天都被各种各样的色彩包围着。尽管我们看到的视觉效果是真实的,并没有欺骗的成分,但它的性质类似魔术表演。探索色彩现象的实验像一种特殊而朴实的魔术。谜底就摆在眼前,它并不依靠藏匿真相来欺骗眼睛,恰恰相反.它所创造的假象借助于观察者的想象力,让人能真实地感受到现实世界与人为虚构的关联,帮助我们看清现实的主观构造。 关键词色彩感知联想心理 正文 1.色彩心理及联想 色彩的直接性心理效应来自色彩的物理光刺激,对人的生理发生直接界的影响。心学家发现,在红色环境中,人的脉搏会加快,血压也有所升高,情绪有所升高而处在蓝色环境中,脉搏会减缓,情绪也较沉静。有的科学家发现,颜色能影脑电波,红色的反应是警觉,对蓝色的反应是放松。冷色与暖色是依据心理错对色彩的物理性分类,对于颜色的物质性印象,大致由冷暖两个色系产生。红黄色的光本身有暖和感,照射到任何色都会有暖和感。紫蓝绿色光有寒冷的感觉,夏日我们关掉白炽灯,打开荧光灯,就会有一种凉爽的感觉,颜料也是一样,如在冷饮的包装上使用冷色调,视觉上会引起人们对这些食物冰冷的感觉;冬日把窗帘换成暖色,就会增加室内的暖和感。以上的冷暖感觉并非来自物理上的真实温度,而是与我们的视觉经验和心理联想有关。 冷色与暖色还会带来一些其它感受,重量感、湿度感等,比方说,暖色偏重,冷色偏轻;暖色有密度的感觉,冷色有稀薄的感;两者相比,冷色有透明感,暖色透明感较弱;冷色显得湿润,暖色显得干燥;冷色有退远的感觉,暖色有迫切感,这些感觉是受我们心理作用而产生的主观印象,属于一种心理错觉。 2.色彩三要素 2.1色相:指色彩的相貌,是区别色彩种类的名称。指不同波长的光给人的不同的色彩感受。红、橙、黄、绿、蓝、紫等每个字都代表一类具体的色相,它们之间的差别属于色相差别。在应用色彩理论中,通常用色环来表示色彩系列。处于可见光谱的两个极端红色与紫色在色环上联结起来,使色相系列呈循环的秩序。最简单的色环由光谱上的6个色相环绕而成。如果在这6色相之间增加一个过渡色相,这样就在红与橙之间增加了红橙色;红与紫之间增加了紫红色,以次类推,还可以增加黄橙、黄绿、蓝绿、蓝紫各色,构成了12色环,12色相是很容易分清的色相。如果在12色相间再增加一个过渡色相,如在黄绿与黄之间增加一个绿味黄在黄绿与绿之间增加一个黄味绿,以此类推,就会组成一个24色的色相环。24色相环更加微妙柔和。色相涉及的是色彩“质”方面的特征。 2.2 明度:明度指色彩的明暗程度,任何色彩都有自己的明暗特征。从光谱上可以看到最明亮的颜色是黄色,处于光谱的中心位置。最暗的是紫色,处于光谱的

哈希算法介绍

哈希算法介绍 LG GROUP system office room 【LGA16H-LGYY-LGUA8Q8-LGA162】

哈希算法简介

目录 1哈希算法概念 ...................................................... 2哈希函数 .......................................................... 3冲突的解决方法 .................................................... 4哈希算法应用 ......................................................

关键词: 算法、哈希、c语言 摘要: 哈希算法在软件开发和Linux内核中多次被使用,由此可以见哈希算法的实用性和重要性。本文介绍了哈希算法的原理和应用,并给出了简略的代码实现,以便读者理解。

1哈希算法概念 哈希(hash 散列,音译为哈希)算法将任意长度的二进制值映射为固定长度的较小二进制值,这个小的二进制值称为哈希值。 哈希值是一段数据唯一且极其紧凑的数值表示形式。如果散列一段明文而且哪怕只更改该段落的一个字母,随后的哈希算法都将产生不同的值。要找到散列为同一个值的两个不同的输入,在计算上是不可能的,所以数据的哈希值可以检验数据的完整性。 哈希表是根据设定的哈希函数H(key)和处理冲突方法将一组关键字映象到一个有限的地址区间上,并以关键字在地址区间中的项作为记录在表中的存储位置,这种表称为哈希表,所得存储位置称为哈希地址。作为线性数据结构与表格和队列等相比,哈希表无疑是查找速度比较快的一种。 查找一般是对项的摸个部分(及数据成员)进行,这部分称为键(key)。例如,项可以由字符串作为键,附带一些数据成员。 理想的哈希表数据结构只不过是一个包含一些项的具有固定大小的数组。 通常的习惯是让项从0到 TableSize-1之间变化。 将每个键映射到0到TableSize-1 这个范围中的某个 数,并且将其放到适当的单元中,这个映射就称为散列函数 (hash funciton)。 如右图,john被散列到3,phil被散列到4,dave 被散列 到6,mary被散列到7. 这是哈希的基本思想。剩下的问题则是要选择一个函数, 决定当两个键散列到同一个值的时候(称为冲突),应该做 什么。

哈 希 常 见 算 法 及 原 理 ( 2 0 2 0 )

哈希算法乱谈(摘自知乎) 最近【现场实战追-女孩教-学】初步了解了Hash算法的相关知识,一些人的见解让我能够迅速的了解相对不熟悉的知识,故想摘录下来,【QQ】供以后温故而知新。 HASH【⒈】算法是密码学的基础,比较常用的有MD5和SHA,最重要的两【О】条性质,就是不可逆和无冲突。 所谓不【1】可逆,就是当你知道x的HASH值,无法求出x; 所谓无【б】冲突,就是当你知道x,无法求出一个y,使x与y的HA【9】SH值相同。 这两条性【⒌】质在数学上都是不成立的。因为一个函数必然可逆,且【2】由于HASH函数的值域有限,理论上会有无穷多个不同的原始值【6】,它们的hash值都相同。MD5和SHA做到的,是求逆和求冲突在计算上不可能,也就是正向计算很容易,而反向计算即使穷尽人类所有的计算资-源都做不到。 顺便说一下,王小云教授曾经成功制造出MD5的碰撞,即md5(a) = md5(b)。这样的碰撞只能随机生成,并不能根据一个已知的a求出b(即并没有破坏MD5的无冲突特性)。但这已经让他声名大噪了。 HASH算法的另外一个很广泛的用途,就是很多程序员都会使用的在数据库中保存用户密码的算法,通常不会直接保存用户密码(这样DBA就能看到用户密码啦,好危险啊),而是保存密码的HASH值,验

证的时候,用相同的HASH函数计算用户输入的密码得到计算HASH值然后比对数据库中存储的HASH值是否一致,从而完成验证。由于用户的密码的一样的可能性是很高的,防止DBA猜测用户密码,我们还会用一种俗称“撒盐”的过程,就是计算密码的HASH值之前,把密码和另外一个会比较发散的数据拼接,通常我们会用用户创建时间的毫秒部分。这样计算的HASH值不大会都是一样的,会很发散。最后,作为一个老程序员,我会把用户的HASH值保存好,然后把我自己密码的HASH值保存到数据库里面,然后用我自己的密码和其他用户的用户名去登录,然后再改回来解决我看不到用户密码而又要“偷窥”用户的需要。最大的好处是,数据库泄露后,得到用户数据库的黑客看着一大堆HASH值会翻白眼。 哈希算法又称为摘要算法,它可以将任意数据通过一个函数转换成长度固定的数据串(通常用16进制的字符串表示),函数与数据串之间形成一一映射的关系。 举个粒子,我写了一篇小说,摘要是一个string:'关于甲状腺精灵的奇妙冒险',并附上这篇文章的摘要是'2d73d4f15c0db7f5ecb321b6a65e5d6d'。如果有人篡改了我的文章,并发表为'关于JOJO的奇妙冒险',我可以立即发现我的文章被篡改过,因为根据'关于JOJO的奇妙冒险'计算出的摘要不同于原始文章的摘要。 可见,摘要算法就是通过摘要函数f()对任意长度的数据data计算出固定长度的摘要digest,目的是为了发现原始数据是否被人篡

哈 希 常 见 算 法 及 原 理

数据结构与算法-基础算法篇-哈希算法 1. 哈希算法 如何防止数据库中的用户信息被脱库? 你会如何存储用户密码这么重要的数据吗?仅仅 MD5 加密一下存储就够了吗? 在实际开发中,我们应该如何用哈希算法解决问题? 1. 什么是哈希算法? 将任意长度的二进制值串映射成固定长度的二进制值串,这个映射的规则就是哈希算法,而通过原始数据映射之后得到的二进制值串就是哈希值。 2. 如何设计一个优秀的哈希算法? 单向哈希: 从哈希值不能反向推导出哈希值(所以哈希算法也叫单向哈希算法)。 篡改无效: 对输入敏感,哪怕原始数据只修改一个Bit,最后得到的哈希值也大不相同。 散列冲突: 散列冲突的概率要很小,对于不同的原始数据,哈希值相同的概率非常小。 执行效率: 哈希算法的执行效率要尽量高效,针对较长的文本,也能快速计算哈

希值。 2. 哈希算法的常见应用有哪些? 7个常见应用:安全加密、唯一标识、数据校验、散列函数、负载均衡、数据分片、分布式存储。 1. 安全加密 常用于加密的哈希算法: MD5:MD5 Message-Digest Algorithm,MD5消息摘要算法 SHA:Secure Hash Algorithm,安全散列算法 DES:Data Encryption Standard,数据加密标准 AES:Advanced Encryption Standard,高级加密标准 对用于加密的哈希算法,有两点格外重要,第一点是很难根据哈希值反向推导出原始数据,第二点是散列冲突的概率要小。 在实际开发中要权衡破解难度和计算时间来决定究竟使用哪种加密算法。 2. 唯一标识 通过哈希算法计算出数据的唯一标识,从而用于高效检索数据。 3. 数据校验 利用哈希算法对输入数据敏感的特点,可以对数据取哈希值,从而高效校验数据是否被篡改过。 4. 散列函数 1.如何防止数据库中的用户信息被脱库?你会如何存储用户密码这么重要的数据吗?

顾客感知价值管理培训

顾客感知价值管理培训 顾客感知价值管理培训讲师:谭小琥 谭小琥老师 老师介绍: 品牌策略营销专家 ——联邦家居——南方石化谭老师很多实用的方法能直接用到工作中,在很大程度上提高了我们的沟通效率与管理能力。我们会再请谭老师给我们进行三天的培训。 ——绿城集团顾客感知价值与服务质量管理研究框架

一、论文结构 1.1 总体结构的设想 1.1.1研究目的和意义 20世纪90年代以来,顾客价值(Customer Value)理论的最新研究成果不断涌现,它们对该理论体系的补充和完善做出了很大的贡献。但由于多从理论方面进行的探索,使企业在运用这种方法操作时普遍存在这样或那样的缺陷。该研究就是要尽量弥补这些的不足,这是本研究的一个重要目的。 1. 1.1 1.2 1.3 1.4 2. 2.1 2.2 2.3 2.4 2.5动态的顾客期望 3.感知服务质量管理的主要模型以及评价 3.1SERVQUAL评价模型

3.2服务质量差距管理模型 4.顾客价值的构建与探查 4.1顾客期望价值变量的确定 4.2顾客价值构成要素的确定 5. 服务质量管理 5.1全面服务质量管理 5.2服务补救管理 5.3 5.4 5.5 5.6 1. 本人对顾客价值的研究有浓厚的兴趣,在调查研究中,亲身感受到中国企业在如何探查顾客期望价值,创造和实现顾客感知价值方面的重要程度和盲区。所以,我认为该课题的研究不仅是对顾客价值(Customer Value)理论待研究领域的有益探索,更有利于对企业营销实践活动的指导和借鉴。 1.3 预期的创新点 顾客价值的研究已比较成熟,高水平的学术成果也很多,都重视通过增加顾客价值的方法来提高顾客的满意度和忠诚度,但就某一产品而言,顾客价值具体由哪些要素构成,

色彩感知现象综述

色彩感知现象综述 摘要: 我们看到的色彩,实际上是以光为媒体的一种感觉。色彩是人眼在接受光的刺激后,视网膜的兴奋在传递到大脑中枢而产生的感觉。色彩对比指两种或两种以上的色彩并置在一起时产生的色彩差别,这种相互比较关系就是色彩的对比关系。色彩知觉的形成过程,是色彩的相互作用下对人的情绪,思维等诸多方面产生影响的过程。色彩的感知是一个科学化、系统化的色彩训练方式,使我们对色彩美的构成形式获得更多、更深刻的认识。 关键词:色彩的分类、色彩的感知、色彩与情感、色彩与艺术 正文: 1.概述 色彩是光源的可见光谱中不同波长的光波作用在不同的物体上,在人眼中引起的不同视觉反映。色彩来源于光的照射,也就是说没有光就没有色彩,光是人们感知色彩存在的必要条件。色彩是我们视觉感知的首选,它随处可见,只要是有光的地方就有色彩。在生活中,人们对色彩的感知力总是直接而快速的。色彩总是在人们的物质生活、精神生活中发挥着诱人的神奇魅力。源于生活的色彩丰富而灿烂,无论是自然景观还是人为创造,它既满足了我们的视觉享受,又是我们艺术创作的源泉。 色彩是艺术设计者传情达意的最佳表述方式,而色彩的传达方式是视觉,人们认识客观世界的感觉经验80%以上取自视觉。 “所谓视觉,实际上就是通过创造与刺激材料的性质相对应的一般形式结构,来感知眼前的原始材料的活动。”视觉是人的眼睛对客观世界的反映,构成对客观事物的直接认识,是在视感觉的基础上依赖于神经中枢的调节和思维产生的。 色彩随视觉与光影的不同,可产生出无穷无尽的色彩视觉效果,同时色彩又由于所表现的物体与环境的不同,所呈现的视觉效果都不相同。 2.有彩色系的分类:红、黄、蓝三色可以调配衍变出其他各种色彩, 而其他色彩无法调出它们故称三原色,又称三元色。色光的三原色是红、绿、蓝紫,色料的三原色是品红、柠檬黄、湖蓝。 间色:有称为“二次色”由两种原色混合而成。

哈希算法介绍

哈希算法简介

目录 1哈希算法概念 (2) 2哈希函数 (3) 3冲突的解决方法 (3) 4哈希算法应用 (4)

关键词: 算法、哈希、c语言 摘要: 哈希算法在软件开发和Linux内核中多次被使用,由此可以见哈希算法的实用性和重要性。本文介绍了哈希算法的原理和应用,并给出了简略的代码实现,以便读者理解。

1哈希算法概念 哈希(hash 散列,音译为哈希) 算法将任意长度的二进制值映射为固定长度的较小二进制值,这个小的二进制值称为哈希值。 哈希值是一段数据唯一且极其紧凑的数值表示形式。如果散列一段明文而且哪怕只更改该段落的一个字母,随后的哈希算法都将产生不同的值。要找到散列为同一个值的两个不同的输入,在计算上是不可能的,所以数据的哈希值可以检验数据的完整性。 哈希表是根据设定的哈希函数H(key)和处理冲突方法将一组关键字映象到一个有限的地址区间上,并以关键字在地址区间中的项作为记录在表中的存储位置,这种表称为哈希表,所得存储位置称为哈希地址。作为线性数据结构与表格和队列等相比,哈希表无疑是查找速度比较快的一种。 查找一般是对项的摸个部分(及数据成员)进行,这部分称为键(key )。例如,项可以由字符串作为键,附带一些数据成员。 理想的哈希表数据结构只不过是一个包含一些项的具有固定大小的数组。 通常的习惯是让项从0到 TableSize-1之间变化。 将每个键映射到0到TableSize-1 这个范围中的某个数 ,并且将其放到适当的单元中,这个映射就称为散列函数(hash funciton )。 如右图,john 被散列到3,phil 被散列到4,dave 被散列到6,mary 被散列到7. 这是哈希的基本思想。剩下的问题则是要选择一个函数,决定当两个键散列到同一个值的时候(称为冲突),应该做什么。

相关文档
最新文档