
MAP-Elites: лучший в каждой нише
Классическая оптимизация ищет один максимум. Но в робототехнике, генерации уровней и инженерии нужен набор разнообразных хороших решений — библиотека походок под разные поломки, уровни любой сложности, фронт компромиссов.
Это Quality-Diversity. MAP-Elites (2015, arXiv:1504.04909) — простейший алгоритм.
Идея: делим пространство поведений на сетку ниш. В каждой нише храним одно лучшее решение. Генотип мутируем, поведенческий дескриптор (высота шага, энергия) — для адресации ячейки.
Алгоритм:
Пустой архив.
Случайная популяция → оценить fitness и дескриптор → в ячейку (если лучше).
Цикл: выбрать родителя → мутировать → оценить → в ячейку, если пусто или лучше.
Никакого отбора между нишами — только внутри. Это даёт карту всего пространства, а не одну точку.
Код:
```
import numpy as np
# Задача: найти x, y в [-5, 5], максимизируя fitness, ниши определяются по (x, y)
BOUNDS = (-5.0, 5.0)
GRID_SIZE = 20 # число ячеек по каждой оси behavior space
N_ITERATIONS = 5000
MUTATION_SIGMA = 0.2
def fitness(genome):
x, y = genome
# произвольная многомодальная функция для иллюстрации
return -(x**2 + y**2) + 5 np.sin(3 * x) np.cos(3 * y)
def behavior_descriptor(genome):
# в этой игрушечной задаче поведенческий дескриптoр совпадает с генотипом,
# в реальных задачах это обычно совсем другое пространство признаков
return genome
def to_cell(bd):
lo, hi = BOUNDS
idx = ((bd - lo) / (hi - lo) * GRID_SIZE).astype(int)
return tuple(np.clip(idx, 0, GRID_SIZE - 1))
def random_genome():
return np.random.uniform(*BOUNDS, size=2)
def mutate(genome):
child = genome + np.random.normal(0, MUTATION_SIGMA, size=genome.shape)
return np.clip(child, *BOUNDS)
# 1) инициализация случайными решениями
for _ in range(200):
g = random_genome()
f = fitness(g)
cell = to_cell(behavior_descriptor(g))
if cell not in archive or f > archive[cell][1]:
archive[cell] = (g, f)
Вывод: 379 / 400, лучшее (0.527, 0.005), fitness 4.72.
Почему не 400? Три причины:
200 случайных точек не покрывают все ячейки (эффект корзин).
Мутация локальна (σ=0.2). До пустой ячейки без занятых соседей не допрыгнуть — изоляция ниш.
В реальности часть пространства физически недостижима (напр, походка с нулевой энергией и высоким шагом).
Сложность
M — число ячеек в архиве (произведение числа делений по каждому измерению множества поведений), T — число итераций (эволюционных поколений/оценок), D — размерность генотипа, E — стоимость одной оценки решения (симуляция/вычисление приспособленности).
По времени: каждая итерация - это выбор случайного родителя за O(1) (при хранении в виде массива/словаря), мутация за O(D), вычисление дексриптора и приспособленности — доминирующая часть, O(E), и вставка/сравнение в ячейке за O(1). Итого на все итерации - O(T·(D + E))
Вывод: MAP-Elites даёт не "оптимум", а карту компромиссов. Ценятся не проценты заполнения, а покрытие достижимых ниш и разнообразие поведений.
Итог: простой, линейный по числу оценок, даёт инженеру не одну точку, а весь фронт возможностей.
Читать далееFans claim they are being ‘treated as suspects’
Club planning to reinstate tickets before season begins
Manchester United’s official Fans’ Forum, Manchester United Supporters Trust (Must), The 1958 and five other such groups have complained to the club over supporters being “treated as suspects” after some had season tickets suspended as part of a move to stop the illegal reselling of seats.
United last week contacted fans who used six or more devices to access accounts linked to the club or to forward tickets, as in their view this suggested the potential buying of seats to resell. Members are allowed only to forward tickets to other members, or sell them back to United.
Continue reading...The US has carried out a fresh round of strikes against Iran, after three US soldiers were killed in action.
The Pentagon has also admitted that nearly 100 US service members have been injured over the last two weeks, as Tehran launched a wave of reprisals to the tenth consecutive nights of attacks, even as peace talks mediated by Pakistan continue.
Lucy Hough speaks to senior international correspondent Julian Borger
Continue reading...
Всех приветствую!
Данная статья будет посвящена довольно важным вещам, таким как: refreshtoken, метод-уровневой безопасности и примеру реализации правила "свой/чужой профиль"
Читать далее
Through the first two weeks of the 2026 Tour de France, the average temperature of 87.4°F has far exceeded the previous record of 78.6°F in 2022. While this figure will decrease as the race heads into its final phase this week and gains altitude in the French Alps, there is no doubt this year’s conditions are abnormally high. Several areas of France were under a red heat alert and wildfires have put stages at risk of cancellation.
XDS-Astana Team sport director Yvon Ledanois said on July 12 before stage nine: “I’ve done more than 30 Tours and I’ve never seen weather conditions this hot every single day. It isn’t a case of having one extremely hot day and then returning to normal conditions the next.”
The conditions have affected athletes’ health and how they prepare for and recover from the multi-stage race. This includes 27-year-old Tadej Pogačar, who is strengthening his claim as cycling’s greatest of all time at the Tour de France and remains on course for a record-equalling fifth victory in the sport’s showpiece event, taking place from July 4 to July 26.
Despite his otherworldly talent, the Slovenian phenom revealed that he suffered through the record-breaking, deadly European heat wave that has marred this year’s Tour. Pogačar said on July 7 after stage four’s 104°F heat that he “had a full headache” because of the conditions, warning that it becomes "dangerous if you don't keep your body temperature down." According to Climate Central, an international group of scientists and journalists, the heat on July 7 was five times more likely to occur as a result of climate change.
Stage four’s winner, 2019 world champion Mads Pedersen, said “you have to adapt and keep racing” in extreme heat. Experts, however, warn there are clear health risks to doing so, such as heat stroke. XDS-Astana Team medical director Emilio Magni described the condition as “like a short circuit” on the body.

In an effort to protect athlete health and recovery after pushing their bodies through extreme heat, some teams prepared ice baths and paddling pools at stage finishes, while others resorted to more novel preventative measures; Netcompany-INEOS riders prepared for the first stage team time trial in Barcelona with their forearms resting in 47.8°F water, lowering their core temperature without affecting warmed-up leg muscles.
Research published in the journal Nature in February this year found that the frequency and severity of heat stress events across France has risen over the past five decades because of climate change. Lead author Ivana Cvijanovic, climate scientist at the French National Research Institute for Sustainable Development, said in February that Tour de France organizers were “lucky” these events have rarely coincided with the race. That is, until this year.
“My co-authors and I have been following the heat during this Tour with horror,” says Cvijanovic. “This summer is clearly extreme—there was simply no opportunity to be lucky as France and Spain have been under heat wave warnings for weeks.”
Cycling's governing body, the Union Cycliste Internationale (UCI), relaxed its hydration rules due to the heat, allowing riders to take on extra water bottles. Team Picnic-PostNL coach Matt Winston said each rider in the team was going through 28 bottles per stage to stay hydrated, more than triple the usual total.

In 2024, the UCI added a High Temperature Protocol to its Extreme Weather Protocol centered on Wet-Bulb Globe Temperature (WBGT), a measure calculated using temperature, humidity, wind speed, sun angle, and cloud cover that is used by other sports governing bodies. If the WBGT surpasses 82.4°F, the protocol suggests organizers modify the race start time, adapt the course to remove hazardous segments, or cancel the race entirely.
This year, spectators were advised not to attend the final 40km (25 miles) of stage three due to a wildfire threat, and stage nine was shortened by 30km (18 miles) because of the extreme heat wave, but no stages were canceled. The UCI does not publicize its WBGT calculations, meaning it cannot be verified when the 82.4°F threshold is crossed. “Making these data publicly available is very important, both to increase transparency and to help protect spectators,” says Cvijanovic.
Pogačar advocated for stages starting and finishing earlier in the day. “[On July 11] there was a proposal to start at 10 [a.m.], but it doesn’t change anything because then you finish in the heat. You need to start at eight or nine, or even before.”
Broadcasters seeking peak viewing hours in the afternoon are unlikely to support such a change. Both Tour de France general director Christian Prudhomme and technical director Thierry Gouvenou have also suggested that changing the start time at such short notice is impossible due to the Tour’s complex logistics planned months in advance, while reliable heat forecasting is only available days before racing.
If organizers do not have the flexibility to move start times or cancel stages in extreme heat, Cvijanovic says every potentially risky stage should be scheduled early in the morning, adding there are vast, publicly-available climatological datasets that could be used for this purpose.
But beyond stage start times, a warming world is making the Tour’s traditional July calendar slot increasingly untenable. “If I had the power I would change all the calendar and not race in July and August in hot places,” said Pogačar, “but it’s not something I can do.” Prudhomme dismissed the Slovenian’s suggestion because “the Tour de France is July,” but acknowledged that climate change “is drawing nearer. At some point, it will be inescapable. But is that in two years? 10 years? We don’t know.”
Scientists, though, note that Europe is warming at more than double the global average rate, making extreme events like heat waves and wildfires more likely. People around the world, including those at the Tour de France, are experiencing the impacts of climate change now. “We need to think as humans,” said Team Cofidis sport director Bingen Fernández. “We are creating this. We’re burning petrol. Climate change is here.”
Amid the ongoing challenges created by this year’s record temperatures, cycling’s organizational bodies have been criticized by riders, journalists and activist groups for accepting advertising from fossil fuel companies responsible for contributing to climate change. XRG, the gas and chemicals subsidiary of UAE state oil company ADNOC, is a title partner of Pogačar’s UAE Team Emirates. The UCI did not reply to requests for comment ahead of publishing, but when previously asked about fossil fuel sponsorship in cycling said that “fossil fuels is not a category which is restricted for any stakeholders” in its regulations.
"We need to face up to the problem seriously, not superficially," said former European champion Matteo Trentin. “We need to all sit around a table and talk about how climate change is impacting our sport.”
It’s a sentiment echoed by Fernández, who said: “We‘re doing things to cool down the body, but we should do things to cool down the planet.”
“Sadly, this [year’s Tour] is a glimpse of the future if we do nothing to reduce our greenhouse gas emissions,” says Cvijanovic. “This is what a warming world looks like, and it is not fun at all.”
Diligent, popular, unexpected pick for the Treasury has been given a straitjacket – and the job of funding PM’s policy promises
On the frequent occasions that John Healey would travel abroad as defence secretary, he was so determined to keep working he would get the crew to tether a desk to the inside of his military aircraft so he could read his papers.
His diligence is one reason why Andy Burnham, the new prime minister, made Healey his unexpected pick for chancellor on Monday. Allies say others include their shared commitment to re-industrialisation and devolution.
Continue reading...Health secretary says source has been identified despite experts warning infections are likely to keep rising
The US health secretary, Robert F Kennedy Jr, has said the ongoing outbreak of cyclosporiasis – the illness caused by the cyclospora parasite that causes watery and explosive diarrhea – is “under control”.
Kennedy made the remarks one day after the US Food and Drug Administration (FDA) did an about-face on a 27-state recall of shredded iceberg lettuce, calling the reported product a “false positive”.
Continue reading...The row over the sacking of the popular defence minister, Mykhailo Fedorov, highlights questions about the country’s military and political direction
Even as Ukraine’s civilians endure brutal strikes by Russia, thousands have taken to the streets to protest against Volodymyr Zelenskyy’s sacking of Mykhailo Fedorov, the popular young defence minister, last week after he clashed with the commander-in-chief, Oleksandr Syrskyi. On Tuesday night, demonstrators’ calls were answered as the Ukrainian president fired the general and offered Mr Fedorov a “prominent” role and promised an overhaul of the army command.
Mr Fedorov, widely credited for significant improvements in the country’s military performance and reducing corruption, had made a scathing attack on Gen Syrskyi after his dismissal – accusing him of blocking reforms and refusing to cooperate. The general seems to have seen the minister as exceeding his remit and effectively taking control of units. The pair also butted heads over Mr Fedorov’s plans to improve recruitment and training to reduce the deep anger created by the conscription system. A Soviet-schooled military officer deeply embedded within institutions tussled with a young civilian disruptor taking a more agile, improvisational approach.
Continue reading...Such technology solves problem of longer, thinner, energy-saving wings not fitting in airports around the world
Airbus has said it will test folding wings for the next generation of its bestselling planes, as the world’s largest planemaker races to work out the shape of future commercial aircraft by the end of the decade.
Longer, thinner wings made of light but strong composite materials offer the promise of energy savings but present a problem for manufacturers because they will not fit in airports around the world, many of which are already at or near full capacity.
Continue reading...
Проблема, которую не решает обычная оптимизация
Классические методы оптимизации — градиентный спуск, генетические алгоритмы с элитизмом, CMA‑ES — заточены под одну вещь: найти один глобальный максимум функции приспособленности. Всё остальное население на пути к этому максимуму считается расходным материалом и отбрасывается.
Но во многих задачах нас интересует не единственное решение, а набор разнообразных хороших решений:
Эволюционная робототехника. Нужно не одно «оптимальное» положение ног шагающего робота, а целая библиотека походок под разные повреждения — если у робота откажет один сустав, он должен уметь быстро подобрать альтернативную походку вместо повторной оптимизации с нуля.
Процедурная генерация контента в играх. Нужны не «лучшие» уровни, а уровни, покрывающие весь спектр: лёгкие/сложные, линейные/разветвлённые.
Дизайн и инженерия. Инженеру интересно увидеть весь фронт компромиссов (вес vs прочность vs стоимость), а не одну точку.
Открытые (так называемый open‑ended) эволюционные системы, где само понятие «лучшего» плохо определено, а интересна широта поведенческого репертуара.
Это направление получило название Quality‑Diversity (QD) оптимизации: цель — не максимизировать один скаляр, а заполнить пространство возможных поведений решениями, каждое из которых максимально хорошо в своей поведенческой нише.
MAP‑Elites — один из первых и самый концептуально простой алгоритм этого семейства.
Идея алгоритма
MAP‑Elites (Multi‑dimensional Archive of Phenotypic Elites) был предложен в 2015 году.
Читать далее
A new study finds that consumers who are paying a premium for foods advertised as made with avocado oil are probably not getting what they think they're buying.
(Image credit: fcafotodigital)
Health secretary says source has been identified despite experts warning infections are likely to keep rising
The US health secretary, Robert F Kennedy Jr, has said the ongoing outbreak of cyclosporiasis – the illness caused by the cyclospora parasite that causes watery and explosive diarrhea – is “under control”.
Kennedy made the remarks one day after the US Food and Drug Administration (FDA) did an about-face on a 27-state recall of shredded iceberg lettuce, calling the reported product a “false positive”.
Continue reading...Former PM’s supporters question pledge to end factional infighting after more than half his cabinet removed or demoted
Allies of Keir Starmer have questioned Andy Burnham’s pledge to end factional infighting after he removed or demoted more than half of the outgoing prime minister’s cabinet in his first reshuffle.
“This was a deeply factional cabinet reshuffle,” one said. “The idea it was anything else is ridiculous.”
Continue reading...Such technology solves problem of longer, thinner, energy-saving wings not fitting in airports around the world
Airbus has said it will test folding wings for the next generation of its bestselling planes, as the world’s largest planemaker races to work out the shape of future commercial aircraft by the end of the decade.
Longer, thinner wings made of light but strong composite materials offer the promise of energy savings but present a problem for manufacturers because they will not fit in airports around the world, many of which are already at or near full capacity.
Continue reading...Warning to shipping companies, on top of Iran’s chokehold on strait of Hormuz, may severely affect Saudi oil exports
Yemen’s Iranian-aligned Houthis have warned shipping companies that their tankers risk being attacked if they use Saudi Arabian ports, as the militia moved quickly to enforce a blockade announced the previous day.
The Houthi warning for the Red Sea, coming on top of Iran’s threat to shipping on the other side of the Arabian peninsular in the Gulf, could affect the substantial Saudi oil exports that have so far been unscathed by the months-long conflict and deepen the rapidly escalating crisis in the region.
Continue reading...Bhatia backed by father-in-law Lakshmi Mittal
Minority stake deal values the club at £4.5bn
Liverpool’s owner is in talks over selling a minority stake to a consortium led by the former Queens Park Rangers co‑owner Amit Bhatia and backed by his father-in-law Lakshmi Mittal, the billionaire Indian steel magnate. The Guardian understands a sale of 30% of the club is being discussed, with an offer of around £1.35bn on the table.
Fenway Sports Group confirmed in a statement to the Financial Times that it had begun negotiations with a group led by Bhatia over a potential minority share sale that would value Liverpool at about £4.5bn.
Continue reading...