Ideally, you should keep your jar closed during the entire 3-4 week fermentation period. In the first phase of lactic acid fermentation, carbon dioxide (CO2) is produced,
which is produced by the lactic acid bacteria. This forms a protective layer at the top of the jar over the surface of your ferment. Mould or yeast need oxygen to survive and now have no chance of spoiling your vegetables. If you were to open the jar, this protective layer of gas would be swirled around and would not form again, as CO2 is only produced in the first few days. Therefore, it is better for the shelf life if you keep your jar closed until your ferment is ready to eat.
However, if you are fermenting for the very first time and are very curious to see how your vegetables develop over time and would like to taste them after just two weeks, then go ahead. The chances of mould or similar getting on your vegetables are somewhat higher. But if you regularly look into your glass to taste anyway and then carefully press everything back under the brine and weigh it down with the weight, then we would say that's fine. Your thirst for knowledge comes first, is our motto.