The most common way people deal with inputs of varying length is padding.
You first define the desired sequence length, i.e. the input length you want your model yo have. Then any sequences with a shorter length than this are padded either with zeros or with special characters so that they reach the desired length. If an input is larger than your desired ...
Is there any role of convex optimization in AI?
Yes, of course!
If so, in what algorithms or problem settings or systems?
The problem of finding the parameters of a support vector machine can be formulated as a convex optimization problem. Another example is linear regression.
See also the paper Convex Optimization: Algorithms and Complexity (2014) by ...
The main thing to keep in mind when designing a reinforcement learning agent is that you need to develop an interactive environment in which the agent can learn and define the possible moves the agent can make. In your case, the environment is the memory cards.
Next you need to define how the agent can interact with the environment, that is choosing a card ...
Full disclosure: I work at Dessa, the company that developed this tech.
We built a machine learning experiment management tool, called Atlas. The main feature is experiment management, allowing you to run thousands of experiments concurrently. This might help with your problem above https://github.com/dessa-oss