liveBook · Manning

Gene

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

A gene is a heritable unit of biological information that influences an organism's traits and occupies a position on a chromosome.

A gene is a heritable unit of biological information that influences an organism’s traits. Biologically, it is a DNA sequence located on a chromosome; in genetic algorithms, it encodes one or more traits of an individual. section 2.4.3 section 2.5.1

DNA contains ordered base pairs, folds into chromosomes, and includes many genes. A gene may contain hundreds or thousands of base pairs, while a chromosome may contain hundreds or thousands of genes. Genetic algorithms simplify this biology by working mainly with genes and chromosomes and by mimicking selected aspects of meiosis. section 2.5.1

In a genetic algorithm, a gene can be represented in several practical ways:

  • A Boolean or numeric value, such as 0 or 1, occupying one position in a chromosome. section 2.5.2
  • An array value or a group of values, depending on how much information one trait requires. section 2.5.2
  • A structured subgroup representing an object, such as a polygon defined by points, color, and transparency. section 3.5

Genes as a NumPy population

A simple population can contain 100 individuals, each represented by 100 binary genes: pop = np.random.randint(0, 2, size=(population, genes)). Each row is one chromosome and each position is a gene. In the EvoLisa example, groups of ten floating-point values instead encode polygon geometry, color, and alpha, which are extracted and rendered before fitness evaluation. section 2.5.3 section 3.5

Figure 2.7 DNA, genes, chromosomes, a nucleus, and a cell

Use the diagram to trace the relationship between DNA, genes, chromosomes, the nucleus, and the cell. section 2.5.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Defines genes biologically and computationally, then demonstrates representations, but stops short of detailed molecular genetics.
Examples
Uses binary NumPy chromosomes and EvoLisa polygon genes containing coordinates, color, and transparency.
What it assumes
Assumes basic familiarity with traits and arrays while introducing DNA, chromosomes, genes, and simplified meiosis at a high level.
What you can do after
Apply genes by encoding traits as binary values, numeric arrays, or structured value groups for evolutionary optimization.
How it connects
Links genes with DNA, chromosomes, traits, meiosis, genetic algorithms, individuals, and fitness.

Also explained in

Compare how 5 books explain gene →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.