Cohomology groups of infinite dimensional algebras